Skip to content

Conversation

@gb
Copy link

@gb gb commented Sep 12, 2018

Fixes #84

@rahulsrivastava71
Copy link

why this change is required i am not able to get it, as the commit message also do not explain it

@gb
Copy link
Author

gb commented Oct 17, 2018

@rahulsrivastava71 sorry for the lack of the description, IMHO the code was self-explanatory, but let me try to fix it:

Given an entity A that contains an Object B as part of it table fields.

Example:

@Table
class A {
      @Id
      long id;
      @Column
      String field1; 
      @Embedded
      B embeddedField;
}

@Embeddable
class B {
     @Column
     String field2;
     @Column
     String field3;
     @Column
     String field4;
}

In JPA, we have a concept of Embedded/Embeddable.
If you save the entity A, all the fields from the Embeddable B should also be saved.

i.e. Table A { id, field1, field2, field3, field4 }

Without my PR, the embedded/embeddable is completely ignored, so, if you save A,
you only will persist Table A { id, field1 }, after my change, it works as expected.

@rahulsrivastava71
Copy link

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants