Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Cannot Reproduce
-
1.2.0
-
None
-
None
-
DB2, openJPA 1.2.0-r422266:683325
Description
The given entity (referenced as <class>C</class> in the persistence.xml) produce a NullPointerException at runtime enhancement:
// no package
@Entity
@Table(...) // valid table definition
public class C {
private int id;
@Id
@Column(...) // valid column definition
public int getId()
public void setId(int id)
{ this.id=id; }}
The NPE is :
org.apache.openjpa.enhance.ManagedClassSubclasser.setDetachedState(ManagedClassSubclasser.java:299)
org.apache.openjpa.enhance.ManagedClassSubclasser.configureMetaData(ManagedClassSubclasser.java:217)
org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:139)
org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:310)
org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:228)
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:190)
The class is enhanced like a charm when adding a package name.
I would expect either:
1) allow the enhancement of entities without package name [preferred]
2) receive an error message such as "could not enhance an entity without package name".
I set the priority to "Minor" as this is not very likely that an entity is added without package.