Jump to: navigation, search

Difference between revisions of "Dali Project/specs/3.0/2.0ElementCollection"

(Element Collection with Embeddable Type)
(Requirements / Functionality)
Line 66: Line 66:
  
  
=== Element Collection Map Type ===
+
=== Element Collection Map Basic Types===
 +
* column and @Column
 +
* map-key-column and @MapKeyColumn
 +
* map-key-temporal and @MapKeyTemporal
 +
* map-key-enumerated and @MapKeyEnumerated
 +
* map-key-convert and @MapKeyConvert
 +
* Fetch - defaults to Lazy
 +
* collection-table and @Collection Table
 +
** Name defaults to <Entity name>_<attribute name>
 +
 
  
 
'''Element Collection Map with Basic Key and Basic Value Details'''
 
'''Element Collection Map with Basic Key and Basic Value Details'''
Line 72: Line 81:
 
[[Image: ElementCollectionMapBasicKeyAndValue.jpg]]
 
[[Image: ElementCollectionMapBasicKeyAndValue.jpg]]
  
=== Optimistic Locking ===
+
=== Element Collection Map Embeddable Key ===
 
+
* Overrides
*[[Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Extensions_for_Optimistic_Locking|@OptimisticLocking]] annotation supported in Entity and MappedSuperclass classes. Corresponding eclipselink-orm.xml element is optimistic-locking
+
** In Xml use map-key-attribute-override and map-key-association-override
* Type Options
+
** In Java use AttributeOverride(name="key.<name>") and AttributeOverride(name="value.<name>)
** Default (Version Column)
+
** All Columns      -> OptimisticLockingType.ALL_COLUMNS
+
** Changed Columns  -> OptimisticLockingType.CHANGED_COLUMNS
+
** Selected Columns  -> OptimisticLockingType.SELECTED_COLUMNS
+
** Version Column    -> OptimisticLockingType.VERSION_COLUMN
+
* Validation
+
** Type is 'Selected Columns' but no columns are selected
+
** Selected Columns must be mapped and must not be primary keys
+
** If using Optimistic Locking with anything other than Version Column, the @Version annotation will be ignored (warning, not error, for this)
+
** If 'cascade' is set and type is not 'Version Column', warning that it is not supported.
+
** If type is 'Version Column' or @OptimisticLocking is specified without a type, there must be a mapping marked @Version.
+
 
+
* If no @Version annotation exists the Default option will display 'Default (None)
+
* If a Version annotation exists, the default option will display 'Default (Version Column)
+
 
+
  
[[Image: EntityOptimisticLocking2.jpg]]
 
  
 +
[[Image: ElementCollectionMapEmbeddableKeyAndBasicValue.jpg]]
  
'''For Reference, Locking tab from MW'''
+
=== Element Collection Map Entity Key ===
 +
* MapKeyJoinColumn
 +
* MapKeyJoinColumns
  
[[Image: MWLocking.jpg]]
+
[[Image: ElementCollectionMapEntityKeyAndBasicValue.jpg]]
  
 
== API ==
 
== API ==

Revision as of 14:50, 14 December 2009

Functional Specification: Dali Support for JPA 2.0 Element Collection mapping

Feedback

bug 258490 - element collection support


Document History

Date Author Version Description & Notes
12-9-2009 Karen Butzke Draft

Project overview

This feature covers the element collection mapping in the JPA 2.0 spec as well as any EclipseLink extensions.

Goals:

  • Add Generic 2.0 support for Element Collection
  • Add EclipseLink 3.0 support for Element Collection with relevant extensions
  • Provide the appropriate defaults and validation for these settings

Concepts

Present any concepts relevant to the feature.

EclipseLink Element Collection Functional Spec

Requirements / Functionality

Element Collection with Basic Type

  • Target Class - defaults to type of the Collection if it is generic
  • Fetch - defaults to Lazy
  • Collection Table
    • Name defaults to <Entity name>_<attribute name>
  • Column
    • Name default to attribute name
    • Table defaults to collection table name and is not editable


Element Collection Basic Type Details

ElementCollectionBasicType.jpg


Ordering Section

Ordering.jpg

Element Collection with Embeddable Type

  • Attribute and Association override names are derived from the Embeddable type


Element Collection Embeddable Type Details

ElementCollectionEmbeddableType.jpg


Element Collection Map Basic Types

  • column and @Column
  • map-key-column and @MapKeyColumn
  • map-key-temporal and @MapKeyTemporal
  • map-key-enumerated and @MapKeyEnumerated
  • map-key-convert and @MapKeyConvert
  • Fetch - defaults to Lazy
  • collection-table and @Collection Table
    • Name defaults to <Entity name>_<attribute name>


Element Collection Map with Basic Key and Basic Value Details

ElementCollectionMapBasicKeyAndValue.jpg

Element Collection Map Embeddable Key

  • Overrides
    • In Xml use map-key-attribute-override and map-key-association-override
    • In Java use AttributeOverride(name="key.<name>") and AttributeOverride(name="value.<name>)


File:ElementCollectionMapEmbeddableKeyAndBasicValue.jpg

Element Collection Map Entity Key

  • MapKeyJoinColumn
  • MapKeyJoinColumns

ElementCollectionMapEntityKeyAndBasicValue.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.