Entity « Column « JPA Q&A





1. How do I specify a multi-column id in orm xml for a JPA entity?    stackoverflow.com

I'm trying to create a JPA Entity backed by a view which does not have an id. The rows are uniquely defined by two columns, product id and node id. How ...

2. Hibernate Entity dependant on column value    stackoverflow.com

Is it possible with Hibernate to have a single table in the database, which stores multiple types of entities, differentiated by the value of some column? I've got an application that uses ...

3. Id column comes from other table JPA entities    stackoverflow.com

I have two tables in my DB. Table1 with ID and some other columns. Table2 is a relations table where I have the PK from table1 as id in table2 but ...

4. one-to-one and one-to-many to the same column and entity    forum.hibernate.org

Hibernate version: 3.2.3 I have two entities with two associations between them: * a one-to-one association * a one-to-many association Mapping documents: @Entity @Table(name = "envase") public class Envase { private EstadoEnvase estadoActual; private Set estados = new HashSet(); @OneToOne @JoinColumn(name = "id_estadoactual") @org.hibernate.annotations.ForeignKey(name = "fk_envase_estadoenvase") public EstadoEnvase getEstadoActual() { return estadoActual; } @OneToMany(mappedBy = "envase") @org.hibernate.annotations.Cascade( { org.hibernate.annotations.CascadeType.ALL, org.hibernate.annotations.CascadeType.DELETE_ORPHAN }) ...

5. Entity with lots of columns...    forum.hibernate.org

I have this class Award mapping the Award table that has a lots of columns(30). When I do list awards I don't need more than few things (id, description) if I use a projection sql-query like below that will do it. If I use hql that is way too slow because the extra work performed to fetch 30 columns per award. ...