Hibernate JIRA | Quentin Ambard | 5 years ago
  1. 0

    There is an error fetching a collection of a subitem. This affect empty collections : a proxy is intialized on the collection, even fetched. Accessing to this collection fire a new request. Here is a simple mode. Please see test case for complete implementation: @Entity @Table( name = "ITEM" ) public class Item { @Id @GeneratedValue private Long id; @OneToOne(cascade = { CascadeType.ALL }, optional = true, fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "SUB_ITEM_ID") private SubItem subItem ; ... } public class SubItem { @Id @GeneratedValue private Long id; @ElementCollection(targetClass = String.class, fetch = FetchType.LAZY) @CollectionTable(name = "PHONES") @Column(name = "PHONE", nullable = false) private List<String> phones ; ... } the following hql request "from Item i left join fetch i.subItem left join fetch i.subItem.phones" generates this sql request : select as id2_0_, as id1_1_, item0_.SUB_ITEM_ID as SUB2_2_0_, phones3_.SubItem_id as SubItem1_1_0__, phones3_.PHONE as PHONE0__, phones3_.SubItem_id as SubItem1_1_0__, phones3_.PHONE as PHONE0__ from ITEM item0_ left outer join SUB_ITEM subitem1_ on left outer join SUB_ITEM subitem2_ on left outer join PHONES phones3_ on There is an extra left outerjoin. QueryClassLoader.initialize(SelectClause selectClause) can't find the collectionOwner for the PHONES collection : collectionFromElement.getOrigin()is about the second left outer join : "SUB_ITEM subitem2_ on" and the fromElementList is based on the first outer join "subitem1_ on". The following hql request doesn't work either : from Item i left join fetch i.subItem s left join fetch s.phones Request is correctly generated, but the left outer join collectionPersisters is null java.lang.NullPointerException at org.hibernate.loader.BasicLoader.isBag( at org.hibernate.loader.BasicLoader.postInstantiate( at org.hibernate.loader.hql.QueryLoader.<init>( at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile( ... see attached test case for full stack

    Hibernate JIRA | 5 years ago | Quentin Ambard
  2. 0

    Android: Saving Map State in Google map

    Stack Overflow | 9 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.hibernate.loader.BasicLoader.isBag()
    2. Hibernate
      1. org.hibernate.loader.BasicLoader.isBag(
      2. org.hibernate.loader.BasicLoader.postInstantiate(
      3. org.hibernate.loader.hql.QueryLoader.<init>(
      4. org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(
      4 frames