Bug 369964 - [EclipseLink] Dynamic persistence - fix invalid validation in the orm.xml
Summary: [EclipseLink] Dynamic persistence - fix invalid validation in the orm.xml
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard: EclipseLink
Keywords: api, plan
Depends on:
Blocks: 309475
  Show dependency tree
 
Reported: 2012-01-27 11:31 EST by Karen Butzke CLA
Modified: 2012-03-22 09:05 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.