Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLinkNewAttributeMappings"

(Functional Specification: Dali Support for New EclipseLink Attribute Mappings)
(Basic Collection)
Line 49: Line 49:
 
* [[Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Use_the_.40BasicCollection_Annotation|@BasicCollection]] supported in Entity, MappedSuperclass, and Embeddable classes.
 
* [[Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Use_the_.40BasicCollection_Annotation|@BasicCollection]] supported in Entity, MappedSuperclass, and Embeddable classes.
 
* Default fetch type is Lazy
 
* Default fetch type is Lazy
 +
* JoinFetch - Select the check box and the JoinFetch annotation is added.  The combo box will now display Default (Inner)
 
* Default Value Column name is <field/property-name>
 
* Default Value Column name is <field/property-name>
 
* Default [[Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Use_the_.40CollectionTable_Annotation|@CollectionTable]] name is <Entity-name>_<field/property-name>
 
* Default [[Using_EclipseLink_JPA_Extensions_(ELUG)#How_to_Use_the_.40CollectionTable_Annotation|@CollectionTable]] name is <Entity-name>_<field/property-name>

Revision as of 11:15, 22 July 2008

Functional Specification: Dali Support for New EclipseLink Attribute Mappings

Feedback

bug 238460 - basic collection mapping support

bug 238462 - basic map mapping support

bug 238466 - transformation mapping support

Document History

Date Author Version Description & Notes
6-25-2008 Karen Butzke Draft

Project overview

This feature is about adding the new attribute level mappings annotations supported by the EclipseLink JPA extension.

Goals:

  • Add JPA Details view widgets for the BasicCollection, BasicMap and Transformation annotations
  • Add JPA Details view widgets for eclipselink-orm.xml basic-collection, basic-map and transformation elements
  • Provide the appropriate defaults and validation for these mappings

Concepts

Present any concepts relevant to the feature.

EclipseLink BasicCollection annotation documentation

EclipseLink BasicMap annotation documentation

EclipseLink CollectionTable annotation documentation

EclipseLink Transformation annotation documentation

Requirements / Functionality

Basic Collection

  • @BasicCollection supported in Entity, MappedSuperclass, and Embeddable classes.
  • Default fetch type is Lazy
  • JoinFetch - Select the check box and the JoinFetch annotation is added. The combo box will now display Default (Inner)
  • Default Value Column name is <field/property-name>
  • Default @CollectionTable name is <Entity-name>_<field/property-name>
  • Validation
    • Attribute type must be Collection, Set, or List

BasicCollectionMapping.jpg

Basic Map

  • @BasicMap supported in Entity, MappedSuperclass, and Embeddable classes.
  • Default fetch type is Lazy
  • Default Value Column name is <field/property-name>
  • Default Key Column name is <field/property-name>_KEY
  • Default @CollectionTable name is <Entity-name>_<field/property-name>

From the EclipseLink docs, we can create validation for this. Need to verify that I understand the second statement: Note: If you specify @BasicMap on an attribute of type Collection, EclipseLink will throw an exception: the type must be Map. If you specify the fetch type as LAZY, Map implementation classes are also not valid.


BasicMapMapping.jpg

Transformation

  • Supported in Entity, MappedSuperclass, and Embeddable classes.
  • An attribute defaults to a Transformation mapping if it includes a @ReadTransformer, @WriteTransformer or @WriteTransformers annotation.
  • Define either a ReadTransformer or a WriteTransformer or both. If the mapping is read-only then no WriteTransformer should be defined. If the mapping is write-only then no ReadTransformer should be defined.
  • WriteTransformer Column name defaults to attribute name if only one WriteTransformer. If multiple, the column name must be specified.
  • Supports fetch with a default of FetchType.EAGER
  • Supports optional with a default of true
  • Validation errors
    • ReadTransformer or WriteTransformer annotation includes both a method and a transformer class, it is only valid to specify one.
    • Multiple WriteTransformers, but all don't specify a column name
    • WriteTransformer column does not exist on the database.
    • ReadTransformer/WriteTransformer method does not exist on the mapped class.
    • ReadTransformer class does not exist or does not implement org.eclipse.persistence.mappings.transformers.AttributeTransformer.
    • WriteTransformer class does not exist or does not implement org.eclipse.persistence.mappings.transformers.FieldTransformer.


TransformationMapping.jpg


TransformationMappinWriteTransformerDialog.jpg

API

Issues

This section lists the open issues that are still pending that must be decided prior to fully implementing this project's requirements.

Issue # Owner Description / Notes Decision

Future Considerations

During the research for this project the following items were identified as out of scope but are captured here as potential future enhancements. If agreed upon during the review process these should be logged in the bug system.

Back to the top