Package com.axelor.db.mapper
Class Property
java.lang.Object
com.axelor.db.mapper.Property
- Direct Known Subclasses:
JsonProperty
-
Method Summary
Modifier and TypeMethodDescriptionIf this is a multi-valued field (one-to-many, many-to-many), add the specified item to the collection.addAll(Object bean, Collection<?> items) If this is a multi-valued field (one-to-many, many-to-many), add all the specified items to the collection.If this is a multi-valued field, clear the collection values.Get the value of this property from the given bean instance.Class<?> Class<?> getHelp()Class<?> getName()String[]intintgetScale()Class<?> getTitle()getType()booleanbooleanbooleanbooleanbooleanisEnum()booleanbooleanisHidden()booleanisImage()booleanisJson()booleanbooleanbooleanbooleanisOrphan()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisUnique()booleanbooleanSet the value for this property to the given bean instance.<T,U> U setAssociation(U child, T bean) If this is a multi-valued field, ensure the proper parent-child relationship if association is bidirectional (marked with mappedBy attribute).protected voidtoMap()Create aMapof property attributes.toString()booleanvalueChanged(Object bean, Object oldValue) Check whether the property value in the given bean is changed.
-
Method Details
-
getEntity
-
getName
-
getType
-
getJavaType
-
getGenericType
-
getMappedBy
-
getTarget
-
setTarget
-
getTargetName
-
getTargetSearch
-
getEnumType
-
isPrimary
public boolean isPrimary() -
isVersion
public boolean isVersion() -
isRequired
public boolean isRequired() -
isUnique
public boolean isUnique() -
isOrphan
public boolean isOrphan() -
isEqualsInclude
public boolean isEqualsInclude() -
isCopyable
public boolean isCopyable() -
isVirtual
public boolean isVirtual() -
isTransient
public boolean isTransient() -
isJson
public boolean isJson() -
isEnum
public boolean isEnum() -
isPassword
public boolean isPassword() -
isMassUpdate
public boolean isMassUpdate() -
isReference
public boolean isReference() -
isCollection
public boolean isCollection() -
getMaxSize
-
getMinSize
-
getPrecision
public int getPrecision() -
getScale
public int getScale() -
getTitle
-
getHelp
-
isImage
public boolean isImage() -
isNullable
public boolean isNullable() -
isReadonly
public boolean isReadonly() -
isHidden
public boolean isHidden() -
isSequence
public boolean isSequence() -
isTranslatable
public boolean isTranslatable() -
isEncrypted
public boolean isEncrypted() -
isDefaultNow
public boolean isDefaultNow() -
getSequenceName
-
isNameColumn
public boolean isNameColumn() -
getNameSearch
-
getSelection
-
get
Get the value of this property from the given bean instance.- Parameters:
bean- the instance- Returns:
- value of the current property
-
set
Set the value for this property to the given bean instance.If the property is a collection, ensure the proper parent-child relationship marked with mappedBy attribute.
- Parameters:
bean- the bean instancevalue- the value for the property- Returns:
- old value of the property
-
add
If this is a multi-valued field (one-to-many, many-to-many), add the specified item to the collection.- Parameters:
bean- the bean instanceitem- collection item- Returns:
- the same bean instance
-
addAll
If this is a multi-valued field (one-to-many, many-to-many), add all the specified items to the collection.- Parameters:
bean- the bean instanceitems- the items to add- Returns:
- the same bean instance
-
setAssociation
public <T,U> U setAssociation(U child, T bean) If this is a multi-valued field, ensure the proper parent-child relationship if association is bidirectional (marked with mappedBy attribute).- Type Parameters:
T- the type of the parentU- the type of the child- Parameters:
child- the child itembean- the parent bean instance- Returns:
- the updated child instance
-
clear
If this is a multi-valued field, clear the collection values.- Parameters:
bean- the bean instance- Returns:
- the same bean instance
-
valueChanged
Check whether the property value in the given bean is changed.- Parameters:
bean- the bean instance to checkoldValue- the old value to check against- Returns:
- true if changed false otherwise
-
toMap
Create aMapof property attributes. Transient and null valued attributes with be omitted.This method should be used to convert property to JSON format.
- Returns:
- map of property attributes
-
toString
-