Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369964

Summary: [EclipseLink] Dynamic persistence - fix invalid validation in the orm.xml
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JPAAssignee: Karen Butzke <karenfbutzke>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 Keywords: api, plan
Version: 3.1   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard: EclipseLink
Bug Depends on:    
Bug Blocks: 309475    

Description Karen Butzke CLA 2012-01-27 11:31:33 EST
For EclipseLink dynamic persistence, we need to support an orm.xml file without underyling java classes. This means that there is currently a lot of invalid validation:

1. Class [class name] cannot be resolved
2. The java class for mapped type "Employee" has no no-arg constructor defined
  a. other constructor and final/static validation errors
3. The entity has no primary key attribute defined - this can happen if the primary key is defined in a parent class.
  a. also need to test other primary key scenarios
4. Attribute [attribute name] in class [class name] cannot be resolved
5. Element collection mapping - Target class does not exist on the project classpath
6. Target entity does not exist on the project classpath
7. Version mapping - The persistent field or property for a Version mapping must be of type int, Integer, short, Short, long, Long, or Timestamp


There are probably more of these
Comment 1 Karen Butzke CLA 2012-02-17 10:21:37 EST
provisional API changes:

o.e.jpt.jpa.core.context.orm:
OrmPersistentAttribute.convertToVirtual() renamed removeFromXml()
OrmReadOnlyPersistentAttribute.convertToSpecified() renamed addToXml()
OrmReadOnlyPersistentAttribute.convertToSpecified(String) renamed addToXml(String)
OrmPersistentType.getVirtualAttributes() renamed getDefaultAttributes()
OrmPersistentType.VIRTUAL_ATTRIBUTES renamed DEFAULT_ATTRIBUTES
OrmPersistentType.getVirtualAttributesSize() renamed getDefaultAttributesSize()
OrmPersistentType.convertAttributeToVirtual(OrmPersistentAttribute) renamed removeAttributeFromXml(OrmPersistentAttribute)
OrmPersistentType.convertAttributeToSpecified(OrmReadOnlyPersistentAttribute) renamed addAttributeToXml(OrmReadOnlyPersistentAttribute)
OrmPersistentType.convertAttributeToSpecified(OrmReadOnlyPersistentAttribute, String) renamed addAttributeToXml(OrmReadOnlyPersistentAttribute, String)

OrmPersistentType.addSpecifiedAttribute(String mappingKey, String attributeName) - removed this API, it was only being used by tests, and it was incorrectly creating orm.xml attributes without an underlying java attribute. This functionality will now be supported via EclipseLink dynamic persistence support.