Relationship « Data Type « JPA Q&A





1. How handles JPA JOINs with available foreign key entry but not available foreign entry?    stackoverflow.com

I wonder how JPA defines to handle following scenario:

Table A: | Table B:
ID  FK_B | ID
1   10   | 10
2   null | 12
3   ...

2. ORA-01400 cannot insert null error in one to one relationship    stackoverflow.com

i have this code

public void guardarAspirante(AspiranteDTO aspiranteDTO) {
    Aspirante aspirante = new Aspirante();
    String usuarioMovimiento = AspiranteCN.class.getSimpleName();
    Date fecha = new ...

3. Save null value to many-to-one hibernate relationship error    stackoverflow.com

I have two classes - Person and Department. There is a many-to-one relationship between Person and Department.

public class Person {
  private Integer id;
  private String name;
  private Department ...

4. Hibernate: not-null property references a null or transient value    stackoverflow.com

I have 2 classes: Msgand Task that are 1-to-1. If i try to save Msg instance without setting Task instance for it i get.

org.hibernate.PropertyValueException: not-null property references a null or transient value: ...

6. Save null value to many-to-one relationship error    forum.hibernate.org

I have two classes Person and Department and there is a many-to-one relationship between Person and Department. The save operation is normal when there is a value applied to "department" of Person. When I want to save a null value to "department" of Person, there is the following error message. object references an unsaved transient instance - save the transient instance ...

8. one-to-many relationships and blob problems.    forum.hibernate.org

I have two objects A ->* B. Basically a one to many relationship between A and B. A has few simple properties and one clob property. B has few simple properties and one blob property. I can save A without any problem ( with out the relationship) similarly B I can save with out any problem. When I try to save ...

9. Transient Obj errors on deep relationships on save / update    forum.hibernate.org

I have a Parent (Job) that may contain many Children (Sections). Each Section may contain many SubSections. I'm loading an existing Job from one session and am trying to add / save a brand new Section with a new SubSection in a different Session. When trying to save the new SubSection Hibernate throws some exception saying that that SubSection references a ...





10. Relationship foreign key uses '0' instead of null    forum.hibernate.org

I am having a mapping problem. I am mapping to an existing database whose schema would probably take an act of God to change. In this database all primary keys are integer values. In a one-to-many relationship between two tables, instead of making the foreign key null when the relationship does not exist, the programmer sets the foreign key field to ...

11. uuid in many-to-many relationships?    forum.hibernate.org

12. Different number of columns in collection relationships    forum.hibernate.org

Hello there! We're facing a huge problem here. Our DB model (from our costumer) is a total mess. I have two classes Class A{ Pk (a composite made of cityCode, contractNumber, point, recCode) property progCode; Set B; } Class B{ Pk(a composite made of cityCode, progCode) } The problem is, how to map the Class A set to Class B? The ...

13. Null pointer on a many to one relationship    forum.hibernate.org

Hi im using Hibernate 2.0 and im getting a NullPointerException It happens when i call a method find("from Usuario") Here is the Hibernate Query generated ********************************************** Hibernate: select usuario0_.id_usuario as id_usuario, usuario0_.nm_usuario as nm_usuario, usuario0_.ds_login as ds_login, usuario0_.cd_senha as cd_senha, usuario0_.ds_email as ds_email, usuario0_.fl_ativo as fl_ativo, usuario0_.id_tipo_usuario as id_tipo_7_ from usuario usuario0_ Hibernate: select tipousuari0_.id_tipo_usuario as id_tipo_1_0_, tipousuari0_.ds_tipo_usuario as ds_tipo_2_0_ from ...

14. Set null on delete of one to one relationship    forum.hibernate.org

15. how to handle hashset in one to many relationship    forum.hibernate.org

Hi All, I don't find it right thats why I am keeping it for open discussion.I have got many to one relation in my Hibernate tables.. Lets say I have got one Advert table and it has got many options that is linked in different table Advert_Options.In addition to this I have got one Options_Definition table that basically stores various options ...





17. Adding timestamp to many-to-many relationship tables    forum.hibernate.org

Hello Hibernate community, I have a Hibernate32 question that has exceeded my meager abilities. I have a join table that I use to map Users to Channels in a many-to-many relationship as per the code below. Has worked pretty well for us so far, the join table has just two columns, user_id and channel_id, and hibernate manages that relationship for me ...

18. Relationship FK uses '0' instead of null, Take 2    forum.hibernate.org

Good day. I try to implement mapping of ManyToOne association in a legacy database, such that when there is no association, zero (0) is put into a column, not null. To do this, I found three-years-old topic on this forum (Relationship foreign key uses '0' instead of null) where solution was proposed. It is proposed there to use UserType in conjuction ...

19. Hibernate relationship collections ever null?    forum.hibernate.org

We are seeing null collections in Hibernate relationships, and were wondering about the expected behavior for the collections. So, for example, our members have a relationship to the groups they are in: Member: @OneToMany @JoinTable( name="GroupMember", joinColumns=@JoinColumn(name="memberId"), inverseJoinColumns=@JoinColumn(name="groupTypeId")) public Set getGroupTypes() { return groupTypes; } We would expect any Member object loaded from Hibernate to have a non null Set, but ...