com.avaje.ebean.config
Interface CompoundType<V>

Type Parameters:
V - The type of the Value Object

public interface CompoundType<V>

API from creating and getting property values from an Immutable Compound Value Object.

A Compound Value object should contain multiple properties that are stored separately. If you only have a single scalar value you should instead look to use ScalarTypeConverter.

For each property in the compound type you need to implement the CompoundTypeProperty interface. These must be returned from getProperties() in the same order that the properties appear in the constructor.

If your compound type is mutable then you should look to use the JPA Embedded annotation instead of implementing this interface.

When using classpath search Ebean will detect and automatically register any implementations of this interface (along with detecting the entity classes etc).

Author:
rbygrave
See Also:
ScalarTypeConverter

Method Summary
 V create(Object[] propertyValues)
          Create an instance of the compound type given its property values.
 CompoundTypeProperty<V,?>[] getProperties()
          Return the properties in the order they appear in the constructor.
 

Method Detail

create

V create(Object[] propertyValues)
Create an instance of the compound type given its property values.


getProperties

CompoundTypeProperty<V,?>[] getProperties()
Return the properties in the order they appear in the constructor.



Copyright © 2010. All Rights Reserved.