1

I have a Product entity about 30 fields. I like to use EntityGraph to fetch product list except its description that is a CLOB.

I have to add 29 other properties to the EntityGraph. Is there a way to say: all properties except property A?

   EntityGraph<Product> graph = em.createEntityGraph(Product.class);
   graph.addAttributeNodes("id", "name", "size", .....);

Thanks.

Dave
  • 759
  • 2
  • 9
  • 31
  • I've never used entity graphs enough to answer that but another way would be to extract the CLOB field to it's own table and put an lazy relationship and only load when need it. – Desorder Jun 21 '16 at 21:47
  • Sadly there are no convenience methods on EntityGraph to add all then deselect some, manual process. FWIW The JDO FetchPlan equivalent of EntityGraph (designed some years earlier) does have convenience methods so something like that is easy there, but the JPA "expert group" decided not to add such value-added stuff to theirs. – Neil Stockton Jun 22 '16 at 06:33
  • 1
    Don't use EclipseLink but appears to support lazy loading of properties. https://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Lob – Alan Hay Jun 22 '16 at 07:49

0 Answers0