public abstract class DynamicEntityImpl extends java.lang.Object implements DynamicEntity, PersistenceEntity, ChangeTracker, FetchGroupTracker, PersistenceWeavedRest
ValuesAccessor
).
Type/Property Meta-model: This dynamic entity approach also includes a
meta-model facade to simplify access to the types and property information so
that clients can more easily understand the model. Each
DynamicTypeImpl
wraps the underlying EclipseLink
relational-descriptor and the DynamicPropertiesManager
wraps each mapping.
The client application can use these types and properties to facilitate
generic access to the entity instances and are required for creating new
instances as well as for accessing the Java class needed for JPA and
EclipseLink native API calls.
Modifier and Type | Class and Description |
---|---|
static class |
DynamicEntityImpl.PropertyWrapper |
Constructor and Description |
---|
DynamicEntityImpl()
Instantiates a new dynamic entity impl.
|
Modifier and Type | Method and Description |
---|---|
CacheKey |
_persistence_getCacheKey() |
FetchGroup |
_persistence_getFetchGroup()
Return the fetch group being tracked
|
Link |
_persistence_getHref() |
java.lang.Object |
_persistence_getId() |
ItemLinks |
_persistence_getLinks() |
java.beans.PropertyChangeListener |
_persistence_getPropertyChangeListener()
PUBLIC:
Return the PropertyChangeListener for the object.
|
java.util.List<RelationshipInfo> |
_persistence_getRelationships() |
Session |
_persistence_getSession()
Return the session for the object.
|
boolean |
_persistence_isAttributeFetched(java.lang.String attribute)
Return true if the attribute is in the fetch group being tracked.
|
void |
_persistence_resetFetchGroup()
Reset all attributes of the tracked object to the un-fetched state with
initial default values.
|
void |
_persistence_setCacheKey(CacheKey cacheKey) |
void |
_persistence_setFetchGroup(FetchGroup group)
Set a fetch group to be tracked.
|
void |
_persistence_setHref(Link href) |
void |
_persistence_setId(java.lang.Object pk) |
void |
_persistence_setLinks(ItemLinks links) |
void |
_persistence_setPropertyChangeListener(java.beans.PropertyChangeListener listener)
PUBLIC:
Set the PropertyChangeListener for the object.
|
void |
_persistence_setRelationships(java.util.List<RelationshipInfo> relationships) |
void |
_persistence_setSession(Session session)
Set true if the fetch group attributes should be refreshed
|
void |
_persistence_setShouldRefreshFetchGroup(boolean shouldRefreshFetchGroup)
Set true if the fetch group attributes should be refreshed.
|
boolean |
_persistence_shouldRefreshFetchGroup()
Return true if the fetch group attributes should be refreshed.
|
abstract DynamicPropertiesManager |
fetchPropertiesManager()
Fetch properties manager.
|
<T> T |
get(java.lang.String propertyName)
Return the persistence value for the given property as the specified type.
|
java.util.Map<java.lang.String,DynamicEntityImpl.PropertyWrapper> |
getPropertiesMap()
Gets the properties map.
|
DynamicTypeImpl |
getType()
Gets internal impl class of
DynamicType . |
boolean |
isSet(java.lang.String propertyName)
Discover if a property has a persistent value
|
DynamicEntity |
set(java.lang.String propertyName,
java.lang.Object value)
Set the persistence value for the given property to the specified value
|
DynamicEntity |
set(java.lang.String propertyName,
java.lang.Object value,
boolean firePropertyChange)
Sets the.
|
java.lang.String |
toString()
String representation of the dynamic entity using the entity type name
and the primary key values - something like {Emp 10} or {Phone 234-5678 10}.
|
public DynamicEntityImpl()
public abstract DynamicPropertiesManager fetchPropertiesManager()
public java.util.Map<java.lang.String,DynamicEntityImpl.PropertyWrapper> getPropertiesMap()
public DynamicTypeImpl getType() throws DynamicException
DynamicType
.DynamicException
- if type is nullpublic <T> T get(java.lang.String propertyName) throws DynamicException
DynamicEntity
get
in interface DynamicEntity
T
- generic type of the property (if not provided, assume Object).
If the property cannot be cast to the specific type, a DynamicException
will be thrown.propertyName
- the name of a mapped property
If the property cannot be found, a DynamicException
will be thrown.DynamicException
public boolean isSet(java.lang.String propertyName) throws DynamicException
DynamicEntity
isSet
in interface DynamicEntity
propertyName
- the name of a mapped property
If the property cannot be found, a DynamicException
will be thrown.DynamicException
public DynamicEntity set(java.lang.String propertyName, java.lang.Object value) throws DynamicException
DynamicEntity
set
in interface DynamicEntity
propertyName
- the name of a mapped property
If the property cannot be found, a DynamicException
will be thrown.value
- the specified objectDynamicException
public DynamicEntity set(java.lang.String propertyName, java.lang.Object value, boolean firePropertyChange) throws DynamicException
propertyName
- the property namevalue
- the valuefirePropertyChange
- the fire property changeDynamicException
- the dynamic exceptionpublic java.lang.Object _persistence_getId()
_persistence_getId
in interface PersistenceEntity
public void _persistence_setId(java.lang.Object pk)
_persistence_setId
in interface PersistenceEntity
public CacheKey _persistence_getCacheKey()
_persistence_getCacheKey
in interface PersistenceEntity
public void _persistence_setCacheKey(CacheKey cacheKey)
_persistence_setCacheKey
in interface PersistenceEntity
public java.beans.PropertyChangeListener _persistence_getPropertyChangeListener()
ChangeTracker
_persistence_getPropertyChangeListener
in interface ChangeTracker
public void _persistence_setPropertyChangeListener(java.beans.PropertyChangeListener listener)
ChangeTracker
_persistence_setPropertyChangeListener
in interface ChangeTracker
public FetchGroup _persistence_getFetchGroup()
FetchGroupTracker
_persistence_getFetchGroup
in interface FetchGroupTracker
public void _persistence_setFetchGroup(FetchGroup group)
FetchGroupTracker
_persistence_setFetchGroup
in interface FetchGroupTracker
public void _persistence_setShouldRefreshFetchGroup(boolean shouldRefreshFetchGroup)
FetchGroupTracker
_persistence_setShouldRefreshFetchGroup
in interface FetchGroupTracker
public boolean _persistence_shouldRefreshFetchGroup()
FetchGroupTracker
_persistence_shouldRefreshFetchGroup
in interface FetchGroupTracker
public boolean _persistence_isAttributeFetched(java.lang.String attribute)
_persistence_isAttributeFetched
in interface FetchGroupTracker
attribute
- the attributepublic void _persistence_resetFetchGroup()
_persistence_resetFetchGroup
in interface FetchGroupTracker
public java.util.List<RelationshipInfo> _persistence_getRelationships()
_persistence_getRelationships
in interface PersistenceWeavedRest
public void _persistence_setRelationships(java.util.List<RelationshipInfo> relationships)
_persistence_setRelationships
in interface PersistenceWeavedRest
public Link _persistence_getHref()
_persistence_getHref
in interface PersistenceWeavedRest
public void _persistence_setHref(Link href)
_persistence_setHref
in interface PersistenceWeavedRest
public Session _persistence_getSession()
FetchGroupTracker
_persistence_getSession
in interface FetchGroupTracker
public void _persistence_setSession(Session session)
FetchGroupTracker
_persistence_setSession
in interface FetchGroupTracker
public ItemLinks _persistence_getLinks()
_persistence_getLinks
in interface PersistenceWeavedRest
public void _persistence_setLinks(ItemLinks links)
_persistence_setLinks
in interface PersistenceWeavedRest
public java.lang.String toString()
toString
in class java.lang.Object
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference