Package org.openxava.model.meta
Class MetaModel
- java.lang.Object
-
- org.openxava.util.meta.MetaElement
-
- org.openxava.model.meta.MetaModel
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
MetaAggregate
,MetaEntity
public abstract class MetaModel extends MetaElement
- Author:
- Javier Paniza
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MetaModel()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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 anMetaModel
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, ordered alphabetically.java.util.Collection<java.lang.String>
getAllKeyPropertiesNamesOrderedAsInModel()
Includes qualified properties in case of key references, ordered as in model.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 namesjava.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 implementsIHibernateIdGeneratorCalculator
.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()
MetaView
getMetaViewOnlyKeys()
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 and properties from collectionsjava.util.Collection<java.lang.String>
getRecursiveQualifiedPropertiesNamesIncludingCollections()
Does not include Transient propertiesjava.util.Collection
getRecursiveQualifiedPropertiesNamesUntilSecondLevel()
Does not include Transient properties and properties from collectionsjava.util.Collection<java.lang.String>
getRecursiveQualifiedPropertiesNamesUntilSecondLevelIncludingCollections()
Does not include Transient propertiesjava.util.Collection
getReferencesNames()
java.util.Collection<java.lang.String>
getRequiredMemberNames()
java.util.Collection
getRequiredPropertiesNames()
java.lang.String
getVersionPropertyName()
java.util.Collection
getViewPropertiesNames()
boolean
hasDateTimeProperty()
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.lang.Object pojo)
The string representation of models represented by this meta model, from a pojo object.java.lang.String
toString(java.util.Map key)
The string representation of models represented by this meta model, from a map with its values.-
Methods inherited from class org.openxava.util.meta.MetaElement
getDescription, getDescription, getDescription, getDescription, getId, getLabel, getLabel, getLabel, getLabel, getLocale, getName, getPlaceholder, getPlaceholder, getPlaceholder, has18nLabel, hasName, setDescription, setLabel, setName, setPlaceholder
-
-
-
-
Method Detail
-
getAllPersistent
public static java.util.Collection getAllPersistent() throws XavaException
All models (Entities and Aggregates) with a mapping associated.- Returns:
- of type MetaModel
- Throws:
XavaException
-
getAllPojoGenerated
public static java.util.Collection getAllPojoGenerated() throws XavaException
All models (Entities and Aggregates) where its POJO code and Hiberante mapping is generated.- Returns:
- of type MetaModel
- Throws:
XavaException
-
addMetaFinder
public void addMetaFinder(MetaFinder metaFinder)
-
addMetaMethod
public void addMetaMethod(MetaMethod metaMethod)
-
addMetaCalculatorPostCreate
public void addMetaCalculatorPostCreate(MetaCalculator metaCalculator)
-
addMetaCalculatorPostLoad
public void addMetaCalculatorPostLoad(MetaCalculator metaCalculator)
-
addMetaCalculatorPostModify
public void addMetaCalculatorPostModify(MetaCalculator metaCalculator)
-
addMetaCalculatorPreRemove
public void addMetaCalculatorPreRemove(MetaCalculator metaCalculator)
-
addMetaValidator
public void addMetaValidator(MetaValidator metaValidator)
-
addMetaValidatorRemove
public void addMetaValidatorRemove(MetaValidator metaValidator)
-
getQualifiedName
public java.lang.String getQualifiedName()
If entity the name of component, if aggregate the name of component + the name of aggregate.
-
setQualifiedName
public void setQualifiedName(java.lang.String qualifiedName)
If entity the name of component, if aggregate the name of component + the name of aggregate.
-
getMetaFinders
public java.util.Collection getMetaFinders()
- Returns:
- Collection of MetaFinder. Not null
-
getMetaMethods
public java.util.Collection getMetaMethods()
- Returns:
- Collection of MetaMethod. Not null
-
addMetaProperty
public void addMetaProperty(MetaProperty newMetaProperty) throws XavaException
- Parameters:
newMetaProperty
- not null- Throws:
XavaException
-
hasDefaultCalculatorOnCreate
public boolean hasDefaultCalculatorOnCreate()
-
addMetaReference
public void addMetaReference(MetaReference newMetaReference) throws XavaException
- Parameters:
newMetaReference
- not null- Throws:
XavaException
-
addMetaView
public void addMetaView(MetaView newMetaView) throws XavaException
- Throws:
XavaException
-
addMetaCollection
public void addMetaCollection(MetaCollection newMetaCollection)
- Parameters:
newMetaCollection
- not null
-
containsMetaProperty
public boolean containsMetaProperty(java.lang.String property)
-
containsMetaPropertyView
public boolean containsMetaPropertyView(java.lang.String property)
-
containsMetaReference
public boolean containsMetaReference(java.lang.String reference)
-
containsMetaCollection
public boolean containsMetaCollection(java.lang.String collection)
-
getPropertiesClass
public java.lang.Class getPropertiesClass() throws XavaException
Class that contains the properties defined in this model.- Returns:
- Not null
- Throws:
XavaException
-
getMetaMember
public MetaMember getMetaMember(java.lang.String name) throws ElementNotFoundException, XavaException
-
getMetaProperty
public MetaProperty getMetaProperty(java.lang.String name) throws ElementNotFoundException, XavaException
Support qualified for properties of references with dot (.).
-
getMetaPropertyView
public MetaProperty getMetaPropertyView(java.lang.String name) throws ElementNotFoundException, XavaException
-
getMetaReference
public MetaReference getMetaReference(java.lang.String name) throws ElementNotFoundException, XavaException
- Parameters:
name
- May be qualified, that is myreference.mynestedreference- Throws:
ElementNotFoundException
XavaException
-
getMetaMethod
public MetaMethod getMetaMethod(java.lang.String name) throws ElementNotFoundException, XavaException
-
getMetaCollection
public MetaCollection getMetaCollection(java.lang.String name) throws ElementNotFoundException, XavaException
- Parameters:
name
- May be qualified, that is mycollection.mynestedcollection- Throws:
ElementNotFoundException
XavaException
-
getMetaView
public MetaView getMetaView(java.lang.String name) throws ElementNotFoundException, XavaException
-
getMetaViews
public java.util.Collection getMetaViews() throws XavaException
- Throws:
XavaException
-
getMembersNames
public java.util.Collection<java.lang.String> getMembersNames()
Ordered as in component definition file.- Returns:
- Not null, read only and serializable
-
getMembersNamesNestingAggregates
public java.util.Collection<java.lang.String> getMembersNamesNestingAggregates()
-
getPropertiesNames
public java.util.List getPropertiesNames()
Ordered as in component definition.- Returns:
- Not null, read only and serializable
-
getReferencesNames
public java.util.Collection getReferencesNames()
- Returns:
- Not null, read only and serializable
-
getColectionsNames
public java.util.Collection getColectionsNames()
- Returns:
- Not null, read only and serializable
-
getEntityReferencesNames
public java.util.Collection getEntityReferencesNames() throws XavaException
- Throws:
XavaException
-
getAggregateReferencesNames
public java.util.Collection getAggregateReferencesNames() throws XavaException
- Throws:
XavaException
-
getMetaCollectionsAgregate
public java.util.Collection getMetaCollectionsAgregate() throws XavaException
- Returns:
- Collection of MetaCollection, not null and read only
- Throws:
XavaException
-
getRequiredPropertiesNames
public java.util.Collection getRequiredPropertiesNames() throws XavaException
- Returns:
- Collection of String, not null and read only
- Throws:
XavaException
-
getRequiredMemberNames
public java.util.Collection<java.lang.String> getRequiredMemberNames() throws XavaException
- Returns:
- Collection of String, not null and read only
- Throws:
XavaException
-
getKeyPropertiesNames
public java.util.Collection<java.lang.String> getKeyPropertiesNames() throws XavaException
Key properties names ordered in declaration order.- Returns:
- Collection of String, not null and read only
- Throws:
XavaException
-
getKeyReferencesNames
public java.util.Collection getKeyReferencesNames() throws XavaException
Key reference names in undetermined order.- Returns:
- Collection of String, not null and read only
- Throws:
XavaException
-
getAllKeyPropertiesNames
public java.util.Collection<java.lang.String> getAllKeyPropertiesNames() throws XavaException
Includes qualified properties in case of key references, ordered alphabetically.- Returns:
- Collection of String, not null and read only
- Throws:
XavaException
-
getAllKeyPropertiesNamesOrderedAsInModel
public java.util.Collection<java.lang.String> getAllKeyPropertiesNamesOrderedAsInModel() throws XavaException
Includes qualified properties in case of key references, ordered as in model.- Returns:
- Collection of String, not null and read only
- Throws:
XavaException
- Since:
- 7.2.1
-
getPropertiesNamesWithoutHiddenNorTransient
public java.util.List<java.lang.String> getPropertiesNamesWithoutHiddenNorTransient() throws XavaException
Ordered as in component definition.Calculated properties are included.
- Returns:
- Collection of String, not null and read only
- Throws:
XavaException
-
getMetaPropertiesKey
public java.util.Collection<MetaProperty> getMetaPropertiesKey() throws XavaException
- Returns:
- Collection of MetaProperty, not null and read only
- Throws:
XavaException
-
getMetaMembersKey
public java.util.Collection getMetaMembersKey() throws XavaException
Key members.- Returns:
- Collection of MetaMember, not null and read only
- Throws:
XavaException
-
getAllMetaPropertiesKey
public java.util.List<MetaProperty> getAllMetaPropertiesKey() throws XavaException
Include qualified properties in case of key references.- Returns:
- Collection of MetaProperty, not null and read only
- Throws:
XavaException
-
getMetaPropertiesCalculated
public java.util.Collection getMetaPropertiesCalculated() throws XavaException
- Returns:
- Collection of MetaProperty, not null and read only
- Throws:
XavaException
-
getOnlyReadPropertiesNames
public java.util.Collection getOnlyReadPropertiesNames() throws XavaException
- Returns:
- Collection of String, not null and read only
- Throws:
XavaException
-
getOnlyReadWithFormulaPropertiesNames
public java.util.Collection getOnlyReadWithFormulaPropertiesNames() throws XavaException
- Returns:
- Collection of String, not null and read only
- Throws:
XavaException
-
getCalculatedPropertiesNames
public java.util.Collection getCalculatedPropertiesNames()
- Returns:
- Collection of String, not null and read only
-
getMetaPropertiesWithDefaultValueCalculator
public java.util.Collection getMetaPropertiesWithDefaultValueCalculator()
-
getMetaPropertiesViewWithDefaultCalculator
public java.util.Collection getMetaPropertiesViewWithDefaultCalculator()
-
getMetaReferencesWithDefaultValueCalculator
public java.util.Collection<MetaReference> getMetaReferencesWithDefaultValueCalculator()
-
getMetaPropertiesPersistents
public java.util.Collection<MetaProperty> getMetaPropertiesPersistents() throws XavaException
Ordered as in component definition.- Throws:
XavaException
-
getMetaPropertiesPersistentsFromReference
public java.util.Collection getMetaPropertiesPersistentsFromReference(java.lang.String referenceName) throws XavaException
Ordered as in component definition.- Throws:
XavaException
-
getPersistentPropertiesNames
public java.util.Collection getPersistentPropertiesNames() throws XavaException
Ordered as in component definition.- Throws:
XavaException
-
getMetaPropertiesWithDefaultValueOnCreate
public java.util.Collection<MetaProperty> getMetaPropertiesWithDefaultValueOnCreate() throws XavaException
Excludes calculator that implementsIHibernateIdGeneratorCalculator
.- Returns:
- Collection of String, not null and read only
- Throws:
XavaException
-
getMetaProperties
public java.util.Collection<MetaProperty> getMetaProperties()
- Returns:
- Collection of MetaProperty, not null and read only
-
getMetaReferences
public java.util.Collection<MetaReference> getMetaReferences()
- Returns:
- Collection of MetaReference, not null and read only
-
getMetaEntityReferences
public java.util.Collection getMetaEntityReferences() throws XavaException
- Returns:
- Collection of MetaReference, not null and read only
- Throws:
XavaException
-
getMetaReferencesWithMapping
public java.util.Collection getMetaReferencesWithMapping() throws XavaException
- Returns:
- Collection of MetaReference, not null and read only
- Throws:
XavaException
-
getMetaReferencesToEntity
public java.util.Collection getMetaReferencesToEntity() throws XavaException
- Returns:
- Collection of MetaReference, not null and read only
- Throws:
XavaException
-
getMetaReferencesKey
public java.util.Collection getMetaReferencesKey() throws XavaException
- Returns:
- Collection of MetaReference, not null and read only
- Throws:
XavaException
-
getMetaReferencesKeyAndSearchKey
public java.util.Collection getMetaReferencesKeyAndSearchKey() throws XavaException
- Returns:
- Collection of MetaReference, not null and read only
- Throws:
XavaException
-
getMetaAggregateReferences
public java.util.Collection getMetaAggregateReferences() throws XavaException
- Returns:
- Collection of MetaReference, not null and read only
- Throws:
XavaException
-
getMetaCollections
public java.util.Collection<MetaCollection> getMetaCollections()
- Returns:
- Collection of MetaCollection, not null and read only
-
getMetaViewByDefault
public MetaView getMetaViewByDefault() throws XavaException
- Returns:
- Not null. If no view is set, then it will generate a default one
- Throws:
XavaException
-
getMetaViewOnlyKeys
public MetaView getMetaViewOnlyKeys() throws XavaException
- Throws:
XavaException
- Since:
- 7.1.6
-
getMetaComponent
public MetaComponent getMetaComponent()
Container component of model.- Returns:
- Not null
-
setMetaComponent
public void setMetaComponent(MetaComponent metaComponent)
Container component of model.- Parameters:
metaComponent
- Not null
-
isCalculated
public boolean isCalculated(java.lang.String propertyName) throws XavaException
- Throws:
XavaException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isPojoGenerated
public boolean isPojoGenerated()
-
setPojoGenerated
public void setPojoGenerated(boolean generated)
-
getMapping
public abstract ModelMapping getMapping() throws XavaException
- Throws:
XavaException
-
containsMetaReferenceWithModel
public boolean containsMetaReferenceWithModel(java.lang.String name)
-
extractKeyValues
public java.util.Map extractKeyValues(java.util.Map values) throws XavaException
A map with the values that are keys in the sent map.- Parameters:
values
- Not null- Returns:
- Not null
- Throws:
XavaException
-
extractSearchKeyValues
public java.util.Map extractSearchKeyValues(java.util.Map values) throws XavaException
- Throws:
XavaException
-
extractKeyValuesFlattenEmbeddedIds
public java.util.Map extractKeyValuesFlattenEmbeddedIds(java.util.Map values) throws XavaException
- Throws:
XavaException
- Since:
- 6.2.2
-
isKeyOrSearchKey
public boolean isKeyOrSearchKey(java.lang.String name) throws XavaException
- Throws:
XavaException
-
isKey
public boolean isKey(java.lang.String name) throws XavaException
- Throws:
XavaException
-
isHiddenKey
public boolean isHiddenKey(java.lang.String name) throws XavaException
- Throws:
XavaException
-
isVersion
public boolean isVersion(java.lang.String name) throws XavaException
- Throws:
XavaException
-
containsValidadors
public boolean containsValidadors()
-
getMetaCalculatorsPostCreate
public java.util.List getMetaCalculatorsPostCreate()
- Returns:
- Not null
-
getMetaCalculatorPostCreate
public MetaCalculator getMetaCalculatorPostCreate(int idx)
-
getMetaCalculatorsPostLoad
public java.util.List getMetaCalculatorsPostLoad()
- Returns:
- Not null
-
getMetaCalculatorPostLoad
public MetaCalculator getMetaCalculatorPostLoad(int idx)
-
getMetaCalculatorsPreRemove
public java.util.List getMetaCalculatorsPreRemove()
- Returns:
- Not null
-
getMetaCalculatorPreRemove
public MetaCalculator getMetaCalculatorPreRemove(int idx)
-
getMetaCalculatorsPostModify
public java.util.List getMetaCalculatorsPostModify()
- Returns:
- Not null
-
getMetaCalculatorPostModify
public MetaCalculator getMetaCalculatorPostModify(int idx)
-
getMetaValidators
public java.util.Collection getMetaValidators()
- Returns:
- Not null
-
getMetaValidatorsRemove
public java.util.Collection getMetaValidatorsRemove()
-
toPOJO
public java.lang.Object toPOJO(java.util.Map values) throws XavaException
Create a POJO corresponding to this model, and populate it with the sent values in map format.- Parameters:
values
- Values to populate the pojo. Can contains nested maps. Cannot be null- Throws:
XavaException
-
fillPOJO
public void fillPOJO(java.lang.Object pojo, java.util.Map values) throws XavaException
Fill an already existing POJO corresponding to this model, and populate it with the sent values in map format.- Parameters:
values
- Values to populate the pojo. Can contain nested maps. Cannot be null- Throws:
XavaException
-
toMap
public java.util.Map toMap(java.lang.Object modelObject) throws XavaException
Convert an object of this model in a map of values.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.- Parameters:
modelObject
-- Returns:
- if modelObject is null returns an empty map
- Throws:
XavaException
-
toKeyMap
public java.util.Map toKeyMap(java.lang.Object modelObject) throws XavaException
Convert an object of this model in a map of values with its key values.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.- Parameters:
modelObject
-- Returns:
- if modelObject is null returns an empty map
- Throws:
XavaException
-
toString
public java.lang.String toString(java.util.Map key) throws XavaException
The string representation of models represented by this meta model, from a map with its values.- Returns:
- null if the sent map is null
- Throws:
XavaException
-
toString
public java.lang.String toString(java.lang.Object pojo) throws XavaException
The string representation of models represented by this meta model, from a pojo object.- Returns:
- null if the sent object is null
- Throws:
XavaException
-
getViewPropertiesNames
public java.util.Collection getViewPropertiesNames()
-
getMetaPropertiesView
public java.util.Collection getMetaPropertiesView()
-
getMetaModelContainer
public MetaModel getMetaModelContainer() throws XavaException
If this is a aggregate the return the container, else the main entity.- Returns:
- Not null
- Throws:
XavaException
-
setContainerModelName
public void setContainerModelName(java.lang.String modelName)
-
getContainerModelName
public java.lang.String getContainerModelName()
-
getMetaCollectionsWithConditionInOthersModels
public java.util.Collection getMetaCollectionsWithConditionInOthersModels() throws XavaException
- Throws:
XavaException
-
getMetaColectionsWithConditionReferenceTo
public java.util.Collection getMetaColectionsWithConditionReferenceTo(java.lang.String modelName)
-
addInterfaceName
public void addInterfaceName(java.lang.String name)
-
getInterfacesNames
public java.util.Collection getInterfacesNames()
-
getImplements
public java.lang.String getImplements()
String in java format: comma separate interfaces names
-
getRecursiveQualifiedPropertiesNames
public java.util.Collection getRecursiveQualifiedPropertiesNames() throws XavaException
Does not include Transient properties and properties from collections- Throws:
XavaException
-
getRecursiveQualifiedPropertiesNamesUntilSecondLevel
public java.util.Collection getRecursiveQualifiedPropertiesNamesUntilSecondLevel() throws XavaException
Does not include Transient properties and properties from collections- Throws:
XavaException
- Since:
- 4.9
-
getRecursiveQualifiedPropertiesNamesIncludingCollections
public java.util.Collection<java.lang.String> getRecursiveQualifiedPropertiesNamesIncludingCollections() throws XavaException
Does not include Transient properties- Throws:
XavaException
- Since:
- 6.5
-
getRecursiveQualifiedPropertiesNamesUntilSecondLevelIncludingCollections
public java.util.Collection<java.lang.String> getRecursiveQualifiedPropertiesNamesUntilSecondLevelIncludingCollections() throws XavaException
Does not include Transient properties- Throws:
XavaException
- Since:
- 6.5
-
get
public static MetaModel get(java.lang.String modelName) throws ElementNotFoundException, XavaException
Gets the MetaModel from its name.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");
- Throws:
ElementNotFoundException
- If the component does not have associated any MetaModelXavaException
- Any problem
-
getForPOJO
public static MetaModel getForPOJO(java.lang.Object pojo) throws ElementNotFoundException, XavaException
Gets the MetaModel for the pojo class specified.- Throws:
ElementNotFoundException
- If the pojo does not have associated any MetaModelXavaException
- Any problem
-
getForPOJOClass
public static MetaModel getForPOJOClass(java.lang.Class pojoClass) throws ElementNotFoundException, XavaException
Gets the MetaModel for the pojo class specified.- Throws:
ElementNotFoundException
- If the pojoClass does not have associated any MetaModelXavaException
- Any problem
-
existsForPOJOClass
public static boolean existsForPOJOClass(java.lang.Class pojoClass) throws java.lang.Exception
To ask if the pojo class has anMetaModel
associated.- Throws:
java.lang.Exception
-
getInterfaceName
public java.lang.String getInterfaceName() throws XavaException
- Throws:
XavaException
-
isPOJOAvailable
public boolean isPOJOAvailable()
- Since:
- 5.6.1
-
getPOJOClassName
public java.lang.String getPOJOClassName() throws XavaException
- Throws:
XavaException
-
setPOJOClassName
public void setPOJOClassName(java.lang.String pojoClassName) throws XavaException
- Throws:
XavaException
-
getPOJOClass
public java.lang.Class getPOJOClass() throws XavaException
- Throws:
XavaException
-
getPOJOKeyClass
public java.lang.Class getPOJOKeyClass() throws XavaException
- Throws:
XavaException
-
setPOJOKeyClass
public void setPOJOKeyClass(java.lang.Class pojoKeyClass)
-
isAnnotatedEJB3
public boolean isAnnotatedEJB3()
-
setAnnotatedEJB3
public void setAnnotatedEJB3(boolean annotatedEJB3)
-
getVersionPropertyName
public java.lang.String getVersionPropertyName() throws XavaException
- Throws:
XavaException
-
hasVersionProperty
public boolean hasVersionProperty() throws XavaException
- Throws:
XavaException
-
hasDateTimeProperty
public boolean hasDateTimeProperty()
-
hasHiddenKey
public boolean hasHiddenKey()
-
someModelHasDefaultCalculatorOnCreate
public static boolean someModelHasDefaultCalculatorOnCreate()
-
someModelHasPostCreateCalculator
public static boolean someModelHasPostCreateCalculator()
-
someModelHasPostModifyCalculator
public static boolean someModelHasPostModifyCalculator()
-
someModelHasPreRemoveCalculator
public static boolean someModelHasPreRemoveCalculator()
-
someModelHasPostLoadCalculator
public static boolean someModelHasPostLoadCalculator()
-
getContainerReference
public java.lang.String getContainerReference()
-
setContainerReference
public void setContainerReference(java.lang.String containerReference)
-
isXmlComponent
public boolean isXmlComponent()
- Since:
- 5.6
-
setXmlComponent
public void setXmlComponent(boolean xmlComponent)
- Since:
- 5.6
-
-