public abstract class MetaModel extends MetaElement
Constructor and Description |
---|
MetaModel() |
Modifier and Type | Method and Description |
---|---|
void |
addInterfaceName(java.lang.String name) |
void |
addMetaCalculatorPostCreate(MetaCalculator metaCalculator) |
void |
addMetaCalculatorPostLoad(MetaCalculator metaCalculator) |
void |
addMetaCalculatorPostModify(MetaCalculator metaCalculator) |
void |
addMetaCalculatorPreRemove(MetaCalculator metaCalculator) |
void |
addMetaCollection(MetaCollection newMetaCollection) |
void |
addMetaFinder(MetaFinder metaFinder) |
void |
addMetaMethod(MetaMethod metaMethod) |
void |
addMetaProperty(MetaProperty newMetaProperty) |
void |
addMetaReference(MetaReference newMetaReference) |
void |
addMetaValidator(MetaValidator metaValidator) |
void |
addMetaValidatorRemove(MetaValidator metaValidator) |
void |
addMetaView(MetaView newMetaView) |
boolean |
containsMetaCollection(java.lang.String collection) |
boolean |
containsMetaProperty(java.lang.String property) |
boolean |
containsMetaPropertyView(java.lang.String property) |
boolean |
containsMetaReference(java.lang.String reference) |
boolean |
containsMetaReferenceWithModel(java.lang.String name) |
boolean |
containsValidadors() |
static boolean |
existsForPOJOClass(java.lang.Class pojoClass)
To ask if the pojo class has an
MetaModel associated. |
java.util.Map |
extractKeyValues(java.util.Map values)
A map with the values that are keys in the sent map.
|
java.util.Map |
extractKeyValuesFlattenEmbeddedIds(java.util.Map values) |
java.util.Map |
extractSearchKeyValues(java.util.Map values) |
void |
fillPOJO(java.lang.Object pojo,
java.util.Map values)
Fill an already existing POJO corresponding to this model, and populate it with
the sent values in map format.
|
static MetaModel |
get(java.lang.String modelName)
Gets the MetaModel from its name.
|
java.util.Collection |
getAggregateReferencesNames() |
java.util.Collection<java.lang.String> |
getAllKeyPropertiesNames()
Includes qualified properties in case of key references.
|
java.util.List<MetaProperty> |
getAllMetaPropertiesKey()
Include qualified properties in case of key references.
|
static java.util.Collection |
getAllPersistent()
All models (Entities and Aggregates) with a mapping associated.
|
static java.util.Collection |
getAllPojoGenerated()
All models (Entities and Aggregates) where its POJO code and Hiberante mapping is generated.
|
java.util.Collection |
getCalculatedPropertiesNames() |
java.util.Collection |
getColectionsNames() |
java.lang.String |
getContainerModelName() |
java.lang.String |
getContainerReference() |
java.util.Collection |
getEntityReferencesNames() |
static MetaModel |
getForPOJO(java.lang.Object pojo)
Gets the MetaModel for the pojo class specified.
|
static MetaModel |
getForPOJOClass(java.lang.Class pojoClass)
Gets the MetaModel for the pojo class specified.
|
java.lang.String |
getImplements()
String in java format: comma separate interfaces names
|
java.lang.String |
getInterfaceName() |
java.util.Collection |
getInterfacesNames() |
java.util.Collection<java.lang.String> |
getKeyPropertiesNames()
Key properties names ordered in declaration order.
|
java.util.Collection |
getKeyReferencesNames()
Key reference names in undetermined order.
|
abstract ModelMapping |
getMapping() |
java.util.Collection<java.lang.String> |
getMembersNames()
Ordered as in component definition file.
|
java.util.Collection<java.lang.String> |
getMembersNamesNestingAggregates() |
java.util.Collection |
getMetaAggregateReferences() |
MetaCalculator |
getMetaCalculatorPostCreate(int idx) |
MetaCalculator |
getMetaCalculatorPostLoad(int idx) |
MetaCalculator |
getMetaCalculatorPostModify(int idx) |
MetaCalculator |
getMetaCalculatorPreRemove(int idx) |
java.util.List |
getMetaCalculatorsPostCreate() |
java.util.List |
getMetaCalculatorsPostLoad() |
java.util.List |
getMetaCalculatorsPostModify() |
java.util.List |
getMetaCalculatorsPreRemove() |
java.util.Collection |
getMetaColectionsWithConditionReferenceTo(java.lang.String modelName) |
MetaCollection |
getMetaCollection(java.lang.String name) |
java.util.Collection<MetaCollection> |
getMetaCollections() |
java.util.Collection |
getMetaCollectionsAgregate() |
java.util.Collection |
getMetaCollectionsWithConditionInOthersModels() |
MetaComponent |
getMetaComponent()
Container component of model.
|
java.util.Collection |
getMetaEntityReferences() |
java.util.Collection |
getMetaFinders() |
MetaMember |
getMetaMember(java.lang.String name) |
java.util.Collection |
getMetaMembersKey()
Key members.
|
MetaMethod |
getMetaMethod(java.lang.String name) |
java.util.Collection |
getMetaMethods() |
MetaModel |
getMetaModelContainer()
If this is a aggregate the return the container, else the main entity.
|
java.util.Collection<MetaProperty> |
getMetaProperties() |
java.util.Collection |
getMetaPropertiesCalculated() |
java.util.Collection<MetaProperty> |
getMetaPropertiesKey() |
java.util.Collection<MetaProperty> |
getMetaPropertiesPersistents()
Ordered as in component definition.
|
java.util.Collection |
getMetaPropertiesPersistentsFromReference(java.lang.String referenceName)
Ordered as in component definition.
|
java.util.Collection |
getMetaPropertiesView() |
java.util.Collection |
getMetaPropertiesViewWithDefaultCalculator() |
java.util.Collection |
getMetaPropertiesWithDefaultValueCalculator() |
java.util.Collection<MetaProperty> |
getMetaPropertiesWithDefaultValueOnCreate()
Excludes calculator that implements
IHibernateIdGeneratorCalculator . |
MetaProperty |
getMetaProperty(java.lang.String name)
Support qualified for properties of references with dot (.).
|
MetaProperty |
getMetaPropertyView(java.lang.String name) |
MetaReference |
getMetaReference(java.lang.String name) |
java.util.Collection<MetaReference> |
getMetaReferences() |
java.util.Collection |
getMetaReferencesKey() |
java.util.Collection |
getMetaReferencesKeyAndSearchKey() |
java.util.Collection |
getMetaReferencesToEntity() |
java.util.Collection<MetaReference> |
getMetaReferencesWithDefaultValueCalculator() |
java.util.Collection |
getMetaReferencesWithMapping() |
java.util.Collection |
getMetaValidators() |
java.util.Collection |
getMetaValidatorsRemove() |
MetaView |
getMetaView(java.lang.String name) |
MetaView |
getMetaViewByDefault() |
java.util.Collection |
getMetaViews() |
java.util.Collection |
getOnlyReadPropertiesNames() |
java.util.Collection |
getOnlyReadWithFormulaPropertiesNames() |
java.util.Collection |
getPersistentPropertiesNames()
Ordered as in component definition.
|
java.lang.Class |
getPOJOClass() |
java.lang.String |
getPOJOClassName() |
java.lang.Class |
getPOJOKeyClass() |
java.lang.Class |
getPropertiesClass()
Class that contains the properties defined in this model.
|
java.util.List |
getPropertiesNames()
Ordered as in component definition.
|
java.util.List<java.lang.String> |
getPropertiesNamesWithoutHiddenNorTransient()
Ordered as in component definition.
|
java.lang.String |
getQualifiedName()
If entity the name of component, if aggregate the name of component + the name of
aggregate.
|
java.util.Collection |
getRecursiveQualifiedPropertiesNames()
Does not include Transient properties
|
java.util.Collection |
getRecursiveQualifiedPropertiesNamesUntilSecondLevel()
Does not include Transient properties
|
java.util.Collection |
getReferencesNames() |
java.util.Collection<java.lang.String> |
getRequiredMemberNames() |
java.util.Collection |
getRequiredPropertiesNames() |
java.lang.String |
getVersionPropertyName() |
java.util.Collection |
getViewPropertiesNames() |
boolean |
hasDefaultCalculatorOnCreate() |
boolean |
hasHiddenKey() |
boolean |
hasVersionProperty() |
boolean |
isAnnotatedEJB3() |
boolean |
isCalculated(java.lang.String propertyName) |
boolean |
isHiddenKey(java.lang.String name) |
boolean |
isKey(java.lang.String name) |
boolean |
isKeyOrSearchKey(java.lang.String name) |
boolean |
isPOJOAvailable() |
boolean |
isPojoGenerated() |
boolean |
isVersion(java.lang.String name) |
boolean |
isXmlComponent() |
void |
setAnnotatedEJB3(boolean annotatedEJB3) |
void |
setContainerModelName(java.lang.String modelName) |
void |
setContainerReference(java.lang.String containerReference) |
void |
setMetaComponent(MetaComponent metaComponent)
Container component of model.
|
void |
setPOJOClassName(java.lang.String pojoClassName) |
void |
setPojoGenerated(boolean generated) |
void |
setPOJOKeyClass(java.lang.Class pojoKeyClass) |
void |
setQualifiedName(java.lang.String qualifiedName)
If entity the name of component, if aggregate the name of component + the name of
aggregate.
|
void |
setXmlComponent(boolean xmlComponent) |
static boolean |
someModelHasDefaultCalculatorOnCreate() |
static boolean |
someModelHasPostCreateCalculator() |
static boolean |
someModelHasPostLoadCalculator() |
static boolean |
someModelHasPostModifyCalculator() |
static boolean |
someModelHasPreRemoveCalculator() |
java.util.Map |
toKeyMap(java.lang.Object modelObject)
Convert an object of this model in a map of values with its key values.
|
java.util.Map |
toMap(java.lang.Object modelObject)
Convert an object of this model in a map of values.
|
java.lang.Object |
toPOJO(java.util.Map values)
Create a POJO corresponding to this model, and populate it with
the sent values in map format.
|
java.lang.String |
toString() |
java.lang.String |
toString(java.util.Map key)
The string representation of models represented by this meta model, from
a map with its values.
|
java.lang.String |
toString(java.lang.Object pojo)
The string representation of models represented by this meta model, from
a pojo object.
|
getDescription, getDescription, getDescription, getDescription, getId, getLabel, getLabel, getLabel, getLocale, getName, getPlaceholder, getPlaceholder, getPlaceholder, has18nLabel, hasName, setDescription, setLabel, setName, setPlaceholder
public static java.util.Collection getAllPersistent() throws XavaException
XavaException
public static java.util.Collection getAllPojoGenerated() throws XavaException
XavaException
public void addMetaFinder(MetaFinder metaFinder)
public void addMetaMethod(MetaMethod metaMethod)
public void addMetaCalculatorPostCreate(MetaCalculator metaCalculator)
public void addMetaCalculatorPostLoad(MetaCalculator metaCalculator)
public void addMetaCalculatorPostModify(MetaCalculator metaCalculator)
public void addMetaCalculatorPreRemove(MetaCalculator metaCalculator)
public void addMetaValidator(MetaValidator metaValidator)
public void addMetaValidatorRemove(MetaValidator metaValidator)
public java.lang.String getQualifiedName()
public void setQualifiedName(java.lang.String qualifiedName)
public java.util.Collection getMetaFinders()
public java.util.Collection getMetaMethods()
public void addMetaProperty(MetaProperty newMetaProperty) throws XavaException
newMetaProperty
- not nullXavaException
public boolean hasDefaultCalculatorOnCreate()
public void addMetaReference(MetaReference newMetaReference) throws XavaException
newMetaReference
- not nullXavaException
public void addMetaView(MetaView newMetaView) throws XavaException
XavaException
public void addMetaCollection(MetaCollection newMetaCollection)
newMetaCollection
- not nullpublic boolean containsMetaProperty(java.lang.String property)
public boolean containsMetaPropertyView(java.lang.String property)
public boolean containsMetaReference(java.lang.String reference)
public boolean containsMetaCollection(java.lang.String collection)
public java.lang.Class getPropertiesClass() throws XavaException
XavaException
public MetaMember getMetaMember(java.lang.String name) throws ElementNotFoundException, XavaException
public MetaProperty getMetaProperty(java.lang.String name) throws ElementNotFoundException, XavaException
public MetaProperty getMetaPropertyView(java.lang.String name) throws ElementNotFoundException, XavaException
public MetaReference getMetaReference(java.lang.String name) throws ElementNotFoundException, XavaException
name
- May be qualified, that is myreference.mynestedreferenceElementNotFoundException
XavaException
public MetaMethod getMetaMethod(java.lang.String name) throws ElementNotFoundException, XavaException
public MetaCollection getMetaCollection(java.lang.String name) throws ElementNotFoundException, XavaException
name
- May be qualified, that is mycollection.mynestedcollectionElementNotFoundException
XavaException
public MetaView getMetaView(java.lang.String name) throws ElementNotFoundException, XavaException
public java.util.Collection getMetaViews() throws XavaException
XavaException
public java.util.Collection<java.lang.String> getMembersNames()
public java.util.Collection<java.lang.String> getMembersNamesNestingAggregates()
public java.util.List getPropertiesNames()
public java.util.Collection getReferencesNames()
public java.util.Collection getColectionsNames()
public java.util.Collection getEntityReferencesNames() throws XavaException
XavaException
public java.util.Collection getAggregateReferencesNames() throws XavaException
XavaException
public java.util.Collection getMetaCollectionsAgregate() throws XavaException
XavaException
public java.util.Collection getRequiredPropertiesNames() throws XavaException
XavaException
public java.util.Collection<java.lang.String> getRequiredMemberNames() throws XavaException
XavaException
public java.util.Collection<java.lang.String> getKeyPropertiesNames() throws XavaException
XavaException
public java.util.Collection getKeyReferencesNames() throws XavaException
XavaException
public java.util.Collection<java.lang.String> getAllKeyPropertiesNames() throws XavaException
XavaException
public java.util.List<java.lang.String> getPropertiesNamesWithoutHiddenNorTransient() throws XavaException
Calculated properties are included.
XavaException
public java.util.Collection<MetaProperty> getMetaPropertiesKey() throws XavaException
XavaException
public java.util.Collection getMetaMembersKey() throws XavaException
XavaException
public java.util.List<MetaProperty> getAllMetaPropertiesKey() throws XavaException
XavaException
public java.util.Collection getMetaPropertiesCalculated() throws XavaException
XavaException
public java.util.Collection getOnlyReadPropertiesNames() throws XavaException
XavaException
public java.util.Collection getOnlyReadWithFormulaPropertiesNames() throws XavaException
XavaException
public java.util.Collection getCalculatedPropertiesNames()
public java.util.Collection getMetaPropertiesWithDefaultValueCalculator()
public java.util.Collection getMetaPropertiesViewWithDefaultCalculator()
public java.util.Collection<MetaReference> getMetaReferencesWithDefaultValueCalculator()
public java.util.Collection<MetaProperty> getMetaPropertiesPersistents() throws XavaException
XavaException
public java.util.Collection getMetaPropertiesPersistentsFromReference(java.lang.String referenceName) throws XavaException
XavaException
public java.util.Collection getPersistentPropertiesNames() throws XavaException
XavaException
public java.util.Collection<MetaProperty> getMetaPropertiesWithDefaultValueOnCreate() throws XavaException
IHibernateIdGeneratorCalculator
. XavaException
public java.util.Collection<MetaProperty> getMetaProperties()
public java.util.Collection<MetaReference> getMetaReferences()
public java.util.Collection getMetaEntityReferences() throws XavaException
XavaException
public java.util.Collection getMetaReferencesWithMapping() throws XavaException
XavaException
public java.util.Collection getMetaReferencesToEntity() throws XavaException
XavaException
public java.util.Collection getMetaReferencesKey() throws XavaException
XavaException
public java.util.Collection getMetaReferencesKeyAndSearchKey() throws XavaException
XavaException
public java.util.Collection getMetaAggregateReferences() throws XavaException
XavaException
public java.util.Collection<MetaCollection> getMetaCollections()
public MetaView getMetaViewByDefault() throws XavaException
XavaException
public MetaComponent getMetaComponent()
public void setMetaComponent(MetaComponent metaComponent)
metaComponent
- Not nullpublic boolean isCalculated(java.lang.String propertyName) throws XavaException
XavaException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isPojoGenerated()
public void setPojoGenerated(boolean generated)
public abstract ModelMapping getMapping() throws XavaException
XavaException
public boolean containsMetaReferenceWithModel(java.lang.String name)
public java.util.Map extractKeyValues(java.util.Map values) throws XavaException
values
- Not nullXavaException
public java.util.Map extractSearchKeyValues(java.util.Map values) throws XavaException
XavaException
public java.util.Map extractKeyValuesFlattenEmbeddedIds(java.util.Map values) throws XavaException
XavaException
public boolean isKeyOrSearchKey(java.lang.String name) throws XavaException
XavaException
public boolean isKey(java.lang.String name) throws XavaException
XavaException
public boolean isHiddenKey(java.lang.String name) throws XavaException
XavaException
public boolean isVersion(java.lang.String name) throws XavaException
XavaException
public boolean containsValidadors()
public java.util.List getMetaCalculatorsPostCreate()
public MetaCalculator getMetaCalculatorPostCreate(int idx)
public java.util.List getMetaCalculatorsPostLoad()
public MetaCalculator getMetaCalculatorPostLoad(int idx)
public java.util.List getMetaCalculatorsPreRemove()
public MetaCalculator getMetaCalculatorPreRemove(int idx)
public java.util.List getMetaCalculatorsPostModify()
public MetaCalculator getMetaCalculatorPostModify(int idx)
public java.util.Collection getMetaValidators()
public java.util.Collection getMetaValidatorsRemove()
public java.lang.Object toPOJO(java.util.Map values) throws XavaException
values
- Values to populate the pojo. Can contains nested maps. Cannot be nullXavaException
public void fillPOJO(java.lang.Object pojo, java.util.Map values) throws XavaException
values
- Values to populate the pojo. Can contain nested maps. Cannot be nullXavaException
public java.util.Map toMap(java.lang.Object modelObject) throws XavaException
The model object can be a POJO (of class in getPOJOClass()
)
or any object that implements the interface of this model,
that is, IInvoice, ICustomer, ISeller, etc.
Hence you can use POJOs or EJB2 CMP beans,
or whatever object that implements the interface.
modelObject
- XavaException
public java.util.Map toKeyMap(java.lang.Object modelObject) throws XavaException
The model object can be a POJO (of class in getPOJOClass()
)
or any object that implements the interface of this model,
that is, IInvoice, ICustomer, ISeller, etc.
Hence you can use POJOs or EJB2 CMP beans,
or whatever object that implements the interface.
modelObject
- XavaException
public java.lang.String toString(java.util.Map key) throws XavaException
XavaException
public java.lang.String toString(java.lang.Object pojo) throws XavaException
XavaException
public java.util.Collection getViewPropertiesNames()
public java.util.Collection getMetaPropertiesView()
public MetaModel getMetaModelContainer() throws XavaException
XavaException
public void setContainerModelName(java.lang.String modelName)
public java.lang.String getContainerModelName()
public java.util.Collection getMetaCollectionsWithConditionInOthersModels() throws XavaException
XavaException
public java.util.Collection getMetaColectionsWithConditionReferenceTo(java.lang.String modelName)
public void addInterfaceName(java.lang.String name)
public java.util.Collection getInterfacesNames()
public java.lang.String getImplements()
public java.util.Collection getRecursiveQualifiedPropertiesNames() throws XavaException
XavaException
public java.util.Collection getRecursiveQualifiedPropertiesNamesUntilSecondLevel() throws XavaException
XavaException
public static MetaModel get(java.lang.String modelName) throws ElementNotFoundException, XavaException
Qualified names are supported, that is you can use:
MetaModel.get("Invoice.InvoceDetail");If InvoiceDetail is a aggregate of Invoice component.
For obtaining the entity metamodel you can use the name of the component, in this way
MetaModel.get("Invoice");
ElementNotFoundException
- If the component does not have associated any MetaModelXavaException
- Any problempublic static MetaModel getForPOJO(java.lang.Object pojo) throws ElementNotFoundException, XavaException
ElementNotFoundException
- If the pojo does not have associated any MetaModelXavaException
- Any problempublic static MetaModel getForPOJOClass(java.lang.Class pojoClass) throws ElementNotFoundException, XavaException
ElementNotFoundException
- If the pojoClass does not have associated any MetaModelXavaException
- Any problempublic static boolean existsForPOJOClass(java.lang.Class pojoClass) throws java.lang.Exception
MetaModel
associated.java.lang.Exception
public java.lang.String getInterfaceName() throws XavaException
XavaException
public boolean isPOJOAvailable()
public java.lang.String getPOJOClassName() throws XavaException
XavaException
public void setPOJOClassName(java.lang.String pojoClassName) throws XavaException
XavaException
public java.lang.Class getPOJOClass() throws XavaException
XavaException
public java.lang.Class getPOJOKeyClass() throws XavaException
XavaException
public void setPOJOKeyClass(java.lang.Class pojoKeyClass)
public boolean isAnnotatedEJB3()
public void setAnnotatedEJB3(boolean annotatedEJB3)
public java.lang.String getVersionPropertyName() throws XavaException
XavaException
public boolean hasVersionProperty() throws XavaException
XavaException
public boolean hasHiddenKey()
public static boolean someModelHasDefaultCalculatorOnCreate()
public static boolean someModelHasPostCreateCalculator()
public static boolean someModelHasPostModifyCalculator()
public static boolean someModelHasPreRemoveCalculator()
public static boolean someModelHasPostLoadCalculator()
public java.lang.String getContainerReference()
public void setContainerReference(java.lang.String containerReference)
public boolean isXmlComponent()
public void setXmlComponent(boolean xmlComponent)