Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] AttributeGroup, EntityManager.load(...) with Relations to Abstract Superclass

Hello,

using eclipselink 2.3.3.

i get a Nullpointer in a scenario like this:
Employee LAZY ManyToManyMapping("projects") Project 
HugeProject inherits from Project (HugeProject defines "evangelist") 
SmallProject inherits from Project (SmallProject defines "atheist") 
HugeProject LAZY OneToOneMapping("evangelist") Employee 
SmallProject LAZY OneToOneMapping("aheist") Employee 

// read the Employee 
Employee empRead = em.find(Employee.class, id); 
// create LoadGroup 
LoadGroup lg = new LoadGroup(); 
lg.addAttribute("projects.evangelist"); 
lg.addAttribute("projects.atheist"); 
// load - all SELECT calls executed here 
JpaHelper.getEntityManager(em).load(empRead, lg); 

Depending on the conrete Type the element in Projects has there is a
NullpointerException in AbstractSession Line 4638:
                 while(it.hasNext()) {
                       DatabaseMapping mapping =
builder.getMappingForAttributeName(it.next());
                       // instantiate indirection
                       mapping.instantiateAttribute(object, session);
<--MAPPING is Null
                   }

This is because there is no atheist in HugeProject and no evangelist in
SmallProject Entities.
Another way in creating the LoadGroup for this case?

Best regards
Stefan






--
View this message in context: http://eclipse.1072660.n5.nabble.com/AttributeGroup-EntityManager-load-with-Relations-to-Abstract-Superclass-tp154468p155690.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.


Back to the top