X
- The actual type described by this metatype.public abstract class ErraiManagedType<X> extends Object implements javax.persistence.metamodel.ManagedType<X>
Constructor and Description |
---|
ErraiManagedType(Class<X> javaType) |
Modifier and Type | Method and Description |
---|---|
<Y> void |
addAttribute(javax.persistence.metamodel.Attribute<X,Y> attribute) |
abstract X |
fromJson(javax.persistence.EntityManager em,
com.google.gwt.json.client.JSONValue jsonValue)
Converts the given JSONValue, which represents an instance of this entity
type, into the actual instance of this entity type that exists in the given
EntityManager's persistence context.
|
ErraiAttribute<? super X,?> |
getAttribute(String name)
Return the attribute of the managed
type that corresponds to the specified name.
|
Set<javax.persistence.metamodel.Attribute<? super X,?>> |
getAttributes()
Return the attributes of the managed type.
|
javax.persistence.metamodel.CollectionAttribute<? super X,?> |
getCollection(String name)
Return the Collection-valued attribute of the managed type
that corresponds to the specified name.
|
<E> javax.persistence.metamodel.CollectionAttribute<? super X,E> |
getCollection(String name,
Class<E> elementType)
Return the Collection-valued attribute of the managed type
that corresponds to the specified name and Java element type.
|
javax.persistence.metamodel.Attribute<X,?> |
getDeclaredAttribute(String name)
Return the attribute declared by the managed
type that corresponds to the specified name.
|
Set<javax.persistence.metamodel.Attribute<X,?>> |
getDeclaredAttributes()
Return the attributes declared by the managed type.
|
javax.persistence.metamodel.CollectionAttribute<X,?> |
getDeclaredCollection(String name)
Return the Collection-valued attribute declared by the
managed type that corresponds to the specified name.
|
<E> javax.persistence.metamodel.CollectionAttribute<X,E> |
getDeclaredCollection(String name,
Class<E> elementType)
Return the Collection-valued attribute declared by the
managed type that corresponds to the specified name and Java
element type.
|
javax.persistence.metamodel.ListAttribute<X,?> |
getDeclaredList(String name)
Return the List-valued attribute declared by the managed
type that corresponds to the specified name.
|
<E> javax.persistence.metamodel.ListAttribute<X,E> |
getDeclaredList(String name,
Class<E> elementType)
Return the List-valued attribute declared by the managed
type that corresponds to the specified name and Java
element type.
|
javax.persistence.metamodel.MapAttribute<X,?,?> |
getDeclaredMap(String name)
Return the Map-valued attribute declared by the managed
type that corresponds to the specified name.
|
<K,V> javax.persistence.metamodel.MapAttribute<X,K,V> |
getDeclaredMap(String name,
Class<K> keyType,
Class<V> valueType)
Return the Map-valued attribute declared by the managed
type that corresponds to the specified name and Java key
and value types.
|
Set<javax.persistence.metamodel.PluralAttribute<X,?,?>> |
getDeclaredPluralAttributes()
Return all multi-valued attributes (Collection-, Set-,
List-, and Map-valued attributes) declared by the
managed type.
|
javax.persistence.metamodel.SetAttribute<X,?> |
getDeclaredSet(String name)
Return the Set-valued attribute declared by the managed type
that corresponds to the specified name.
|
<E> javax.persistence.metamodel.SetAttribute<X,E> |
getDeclaredSet(String name,
Class<E> elementType)
Return the Set-valued attribute declared by the managed type
that corresponds to the specified name and Java element type.
|
javax.persistence.metamodel.SingularAttribute<X,?> |
getDeclaredSingularAttribute(String name)
Return the single-valued attribute declared by the managed
type that corresponds to the specified name.
|
<Y> javax.persistence.metamodel.SingularAttribute<X,Y> |
getDeclaredSingularAttribute(String name,
Class<Y> type)
Return the single-valued attribute declared by the
managed type that corresponds to the specified name and
Java type.
|
Set<javax.persistence.metamodel.SingularAttribute<X,?>> |
getDeclaredSingularAttributes()
Return the single-valued attributes declared by the managed
type.
|
Class<X> |
getJavaType()
Return the represented Java type.
|
javax.persistence.metamodel.ListAttribute<? super X,?> |
getList(String name)
Return the List-valued attribute of the managed type that
corresponds to the specified name.
|
<E> javax.persistence.metamodel.ListAttribute<? super X,E> |
getList(String name,
Class<E> elementType)
Return the List-valued attribute of the managed type that
corresponds to the specified name and Java element type.
|
javax.persistence.metamodel.MapAttribute<? super X,?,?> |
getMap(String name)
Return the Map-valued attribute of the managed type that
corresponds to the specified name.
|
<K,V> javax.persistence.metamodel.MapAttribute<? super X,K,V> |
getMap(String name,
Class<K> keyType,
Class<V> valueType)
Return the Map-valued attribute of the managed type that
corresponds to the specified name and Java key and value
types.
|
Set<javax.persistence.metamodel.PluralAttribute<? super X,?,?>> |
getPluralAttributes()
Return all multi-valued attributes (Collection-, Set-,
List-, and Map-valued attributes) of the managed type.
|
javax.persistence.metamodel.SetAttribute<? super X,?> |
getSet(String name)
Return the Set-valued attribute of the managed type that
corresponds to the specified name.
|
<E> javax.persistence.metamodel.SetAttribute<? super X,E> |
getSet(String name,
Class<E> elementType)
Return the Set-valued attribute of the managed type that
corresponds to the specified name and Java element type.
|
javax.persistence.metamodel.SingularAttribute<? super X,?> |
getSingularAttribute(String name)
Return the single-valued attribute of the managed type that
corresponds to the specified name.
|
<Y> ErraiSingularAttribute<? super X,Y> |
getSingularAttribute(String name,
Class<Y> type)
Return the single-valued attribute of the managed
type that corresponds to the specified name and Java type.
|
Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> |
getSingularAttributes()
Return the single-valued attributes of the managed type.
|
Collection<ErraiManagedType<X>> |
getSubtypes()
Returns the collection of entity types that are subclasses of this managed
type.
|
boolean |
isSuperclassOf(javax.persistence.metamodel.ManagedType<?> other)
Returns true if this managed type represents the same Java class or a
superclass of the given type.
|
void |
mergeState(ErraiEntityManager em,
X targetEntity,
X sourceEntity)
Copies the state of the attributes in sourceEntity into targetEntity.
|
X |
newInstance()
Creates and returns a new instance of the represented type.
|
protected <Y> void |
parseInlineJson(X targetEntity,
ErraiAttribute<? super X,Y> attr,
com.google.gwt.json.client.JSONValue attrJsonValue,
ErraiEntityManager eem) |
protected <C,E> void |
parsePluralJsonReference(X targetEntity,
ErraiPluralAttribute<? super X,C,E> attr,
com.google.gwt.json.client.JSONArray attrJsonValues,
ErraiEntityManager eem) |
protected <Y> void |
parseSingularJsonReference(X targetEntity,
ErraiSingularAttribute<? super X,Y> attr,
com.google.gwt.json.client.JSONValue attrJsonValue,
ErraiEntityManager eem) |
com.google.gwt.json.client.JSONValue |
toJson(javax.persistence.EntityManager em,
X sourceEntity) |
String |
toString() |
public <Y> void addAttribute(javax.persistence.metamodel.Attribute<X,Y> attribute)
public X newInstance()
UnsupportedOperationException
- if the represented type is abstract.public boolean isSuperclassOf(javax.persistence.metamodel.ManagedType<?> other)
other
- the ManagedType to checkpublic Collection<ErraiManagedType<X>> getSubtypes()
public abstract X fromJson(javax.persistence.EntityManager em, com.google.gwt.json.client.JSONValue jsonValue)
em
- The EntityManager that owns this entity type and houses the
persistence context.jsonValue
- A value that represents an instance of this entity type.public com.google.gwt.json.client.JSONValue toJson(javax.persistence.EntityManager em, X sourceEntity)
public void mergeState(ErraiEntityManager em, X targetEntity, X sourceEntity)
em
- The entity manager that sourceEntity and targetEntity exist in.targetEntity
- The entity whose attributes' state will be written to. Not null.sourceEntity
- The entity whose attributes' state will be read from. Not null.protected <Y> void parseInlineJson(X targetEntity, ErraiAttribute<? super X,Y> attr, com.google.gwt.json.client.JSONValue attrJsonValue, ErraiEntityManager eem)
protected <Y> void parseSingularJsonReference(X targetEntity, ErraiSingularAttribute<? super X,Y> attr, com.google.gwt.json.client.JSONValue attrJsonValue, ErraiEntityManager eem)
protected <C,E> void parsePluralJsonReference(X targetEntity, ErraiPluralAttribute<? super X,C,E> attr, com.google.gwt.json.client.JSONArray attrJsonValues, ErraiEntityManager eem)
public Set<javax.persistence.metamodel.Attribute<? super X,?>> getAttributes()
javax.persistence.metamodel.ManagedType
getAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public Set<javax.persistence.metamodel.Attribute<X,?>> getDeclaredAttributes()
javax.persistence.metamodel.ManagedType
getDeclaredAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public <Y> ErraiSingularAttribute<? super X,Y> getSingularAttribute(String name, Class<Y> type)
javax.persistence.metamodel.ManagedType
getSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributetype
- the type of the represented attributepublic <Y> javax.persistence.metamodel.SingularAttribute<X,Y> getDeclaredSingularAttribute(String name, Class<Y> type)
javax.persistence.metamodel.ManagedType
getDeclaredSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributetype
- the type of the represented attributepublic Set<javax.persistence.metamodel.SingularAttribute<? super X,?>> getSingularAttributes()
javax.persistence.metamodel.ManagedType
getSingularAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public Set<javax.persistence.metamodel.SingularAttribute<X,?>> getDeclaredSingularAttributes()
javax.persistence.metamodel.ManagedType
getDeclaredSingularAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public <E> javax.persistence.metamodel.CollectionAttribute<? super X,E> getCollection(String name, Class<E> elementType)
javax.persistence.metamodel.ManagedType
getCollection
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributeelementType
- the element type of the represented
attributepublic <E> javax.persistence.metamodel.CollectionAttribute<X,E> getDeclaredCollection(String name, Class<E> elementType)
javax.persistence.metamodel.ManagedType
getDeclaredCollection
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributeelementType
- the element type of the represented
attributeCollectionAttribute
of the given name and
element typepublic <E> javax.persistence.metamodel.SetAttribute<? super X,E> getSet(String name, Class<E> elementType)
javax.persistence.metamodel.ManagedType
getSet
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributeelementType
- the element type of the represented
attributepublic <E> javax.persistence.metamodel.SetAttribute<X,E> getDeclaredSet(String name, Class<E> elementType)
javax.persistence.metamodel.ManagedType
getDeclaredSet
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributeelementType
- the element type of the represented
attributepublic <E> javax.persistence.metamodel.ListAttribute<? super X,E> getList(String name, Class<E> elementType)
javax.persistence.metamodel.ManagedType
getList
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributeelementType
- the element type of the represented
attributepublic <E> javax.persistence.metamodel.ListAttribute<X,E> getDeclaredList(String name, Class<E> elementType)
javax.persistence.metamodel.ManagedType
getDeclaredList
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributeelementType
- the element type of the represented
attributepublic <K,V> javax.persistence.metamodel.MapAttribute<? super X,K,V> getMap(String name, Class<K> keyType, Class<V> valueType)
javax.persistence.metamodel.ManagedType
getMap
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributekeyType
- the key type of the represented attributevalueType
- the value type of the represented attributepublic <K,V> javax.persistence.metamodel.MapAttribute<X,K,V> getDeclaredMap(String name, Class<K> keyType, Class<V> valueType)
javax.persistence.metamodel.ManagedType
getDeclaredMap
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributekeyType
- the key type of the represented attributevalueType
- the value type of the represented attributepublic Set<javax.persistence.metamodel.PluralAttribute<? super X,?,?>> getPluralAttributes()
javax.persistence.metamodel.ManagedType
getPluralAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public Set<javax.persistence.metamodel.PluralAttribute<X,?,?>> getDeclaredPluralAttributes()
javax.persistence.metamodel.ManagedType
getDeclaredPluralAttributes
in interface javax.persistence.metamodel.ManagedType<X>
public ErraiAttribute<? super X,?> getAttribute(String name)
javax.persistence.metamodel.ManagedType
getAttribute
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.Attribute<X,?> getDeclaredAttribute(String name)
javax.persistence.metamodel.ManagedType
getDeclaredAttribute
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.SingularAttribute<? super X,?> getSingularAttribute(String name)
javax.persistence.metamodel.ManagedType
getSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.SingularAttribute<X,?> getDeclaredSingularAttribute(String name)
javax.persistence.metamodel.ManagedType
getDeclaredSingularAttribute
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.CollectionAttribute<? super X,?> getCollection(String name)
javax.persistence.metamodel.ManagedType
getCollection
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.CollectionAttribute<X,?> getDeclaredCollection(String name)
javax.persistence.metamodel.ManagedType
getDeclaredCollection
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.SetAttribute<? super X,?> getSet(String name)
javax.persistence.metamodel.ManagedType
getSet
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.SetAttribute<X,?> getDeclaredSet(String name)
javax.persistence.metamodel.ManagedType
getDeclaredSet
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.ListAttribute<? super X,?> getList(String name)
javax.persistence.metamodel.ManagedType
getList
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.ListAttribute<X,?> getDeclaredList(String name)
javax.persistence.metamodel.ManagedType
getDeclaredList
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.MapAttribute<? super X,?,?> getMap(String name)
javax.persistence.metamodel.ManagedType
getMap
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic javax.persistence.metamodel.MapAttribute<X,?,?> getDeclaredMap(String name)
javax.persistence.metamodel.ManagedType
getDeclaredMap
in interface javax.persistence.metamodel.ManagedType<X>
name
- the name of the represented attributepublic Class<X> getJavaType()
javax.persistence.metamodel.Type
getJavaType
in interface javax.persistence.metamodel.Type<X>
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.