easy-software-ufal / annotations_repos

3 stars 3 forks source link

arey/hibernate-hydrate Nested List are not hydrated using @Embedded annotation #111

Open pmop opened 6 years ago

pmop commented 6 years ago

Issue: https://github.com/arey/hibernate-hydrate/issues/1 Commit: ` Annotations:@Embedded @Embeddable Test:https://github.com/arey/hibernate-hydrate/blob/master/src/test/java/com/javaetmoi/core/persistence/hibernate/TestIssue1Fix.java` reproduces this issue (404).

We have a structure like this:
@Entity
public class Foo {

@Embedded
public Bar bar = new Bar();
}

@Embeddable
public class Bar {
@Onetomany
@Fetch(FetchMode.SELECT)
@Cascade(CascadeType.ALL)
@JoinColumn(name = "FOO_ID")
private List bizs = new ArrayList();
}

doing a : LazyLoadingUtil.deepHydrate(getSession().getSession(EntityMode.POJO), foo);

Doesn’t seem to populate the list of bizs...
Hi Izaak,

Thanks for reporting this first issue. I have reproduced this bug in a unit
test.
The problem comes from the @Embedded / @embeddable annotations. Current
implementation does not support them. I will work on a fix during the next
days.

Regards
pmop commented 6 years ago

I can't propose an operator since this bug is too context specific and I believe that even applying "Add annotation" randomly wouldn't have a chance to reproduce a bug like this.