Community
Participate
Working Groups
http://wiki.eclipse.org/EclipseLink/Development/1.0/ER-200040_DS
Some comments on the design specification BasicCollection suggestion: - you missed the name as a require attribute - the table could be assumed to be the name of the attribute unless the column specifies a different table name <basic-collection name="responsibilities" fetch="LAZY" private-owned="true" join-fetch="INNER"> <column name="DESCRIPTION" table="RESPONSIBILITIES"/> <join-column name="EMPLOYEE_ID" referenced-column-name="EMP_ID"/> </basic-collection> BasicMap suggestion - missed name attribute as well <basic-map name="licenses" fetch="LAZY" private-owned="false" join-fetch="OUTER"> <key converter="licenseConverter"> <column name="LICENSE" table="LICENSES"/> </key> <value converter="Integer2String"> <column name="STATUS"/> </value> <join-column name="RESTAURANT_ID" referenced-column-name="ID"/> </basic-map> RETURNING POLICY: Added a separate bug for this - 215836
The collection table name currently defaults to: className + "_" + attributeName Specifying a table in the value-column is currently redundant. We don't use the table from there to build the collection-table. In your example this would eventually cause an exception, since the value-column maps to a RESPONSIBILITIES table where the the collection table is actually named EMPLOYEE_RESPONSIBILITIES The name attributes were indeed missed, I will add those.
CONVERTER USAGE: We need to have a common agreement on how converters should be used within mappings. Using annotations converters are defined globally for a persistence unit using: @Converter or @StructConverter and then they are used within a given mapping as: @Convert("myConverter") In the ECLIPSELINK-ORM.XML configuration file we need to address a couple of issues: 1. Where can customers define their converters. Using annotations you must define them on some entity which is necessary but a little ugly. Within XML customers should be able to define Converter and StructConverter globally for the persistence unit outside of any particular entity definition. This should align with JPA's ORM.XML as well. 2. The usage of a converter within a mapping needs to be consistent across all mapping types. I believe that since usage of a converter is more of a fringe case that it should be addressed as a nested element and not as an attribute of the mapping element. BASIC USAGE: <basic name="salary"> <converter name="money"/> </basic> In the case of more complex mappings such as the BasicMap where multiple converters can be used it could mean the XML appears as: <basic-map name="licenses"> <key> <column name="LICENSE" table="LICENSES"/> <convert name="license"/> </key> <value> <column name="STATUS"/> <convert name="status"/> </value> <join-column name="RESTAURANT_ID" referenced-column-name="ID"/> </basic-map>
Typo in the Basic converter usage. Should have been: BASIC USAGE: <basic name="salary"> <convert name="money"/> </basic>
Just spoke to Mike, the convert will changed to an element instead of an attribute. The thinking is that anything that has its own annotation should in turn have its own complex element in the schema. I think that is a good rule of thumb to follow. Makes sense ... if the annotation were ever to expand its contents, then the same freedom exists in a complex element (as opposed to an attribute)
>Within XML >customers should be able to define Converter and StructConverter globally for >the persistence unit outside of any particular entity definition. This should >align with JPA's ORM.XML as well. I suggest we follow a similar approach to JPA GeneratedValue generators and allow Converters to be defined either globally or on an Entity. Like generators, they would be globally scoped.
Agreed, right now the plan to allow users to define them at the following levels: entity-mappings entity embeddable mapped-superclass Which mirrors the global definition of generators.
All dependent bugs have now been fixed, therefore this bug is now fixed.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink