- java.lang.Object
-
- org.tentackle.model.impl.CommonOptionsImpl
-
- org.tentackle.model.impl.EntityOptionsImpl
-
- All Implemented Interfaces:
CommonOptions,EntityOptions
public class EntityOptionsImpl extends CommonOptionsImpl implements EntityOptions
Entity options.- Author:
- harald
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringOPTION_NO_MODELDEFAULTSdon't apply model defaults.static java.lang.StringOPTION_NO_PRIMARYdon't generate ID as primary key.static java.lang.StringOPTION_NORMTEXTnormText is provided.static java.lang.StringOPTION_REMOTEenable remoting.static java.lang.StringOPTION_ROOTroot entity.static java.lang.StringOPTION_ROOTCLASSIDrootclassid is provided.static java.lang.StringOPTION_ROOTIDrootid is provided.static java.lang.StringOPTION_TABLESERIALcolumn tableserial is provided.static java.lang.StringOPTION_TOKENLOCKtoken lock columns editedBy/Since/Expiry are provided.-
Fields inherited from class org.tentackle.model.impl.CommonOptionsImpl
BIND_SIZE, OPTION_BIND, OPTION_DERIVED, OPTION_MAPNULL, OPTION_NOCONSTANT, OPTION_NODECLARE, OPTION_NOMETHOD, OPTION_READONLY, OPTION_SETGET, OPTION_SUPER, OPTION_TRIM, OPTION_TRIM_READ, OPTION_TRIM_WRITE, OPTION_WRITEONLY
-
-
Constructor Summary
Constructors Constructor Description EntityOptionsImpl(EntityFactory factory, Entity entity, SourceInfo sourceInfo)Creates entity options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapplyOption(java.lang.String option, java.lang.Boolean ctrl)Applies given option string.EntitygetEntity()Gets the entity this option-set belongs to.java.util.List<java.lang.String>getSorting()Gets the default sorting options.TrackTypegetTrackType()Gets the tracking type.booleanisNoPrimaryKey()true if [NOPKEY]-option set.booleanisNormTextProvided()true if [NORMTEXT]-option set.booleanisRemote()Returns whether entity supports remoting.booleanisRoot()true if [ROOT]-option setbooleanisRootClassIdProvided()true if [ROOTCLASSID]-option set.booleanisRootIdProvided()true if [ROOTID]-option set.booleanisTableSerialProvided()true if [TABLESERIAL]-option set.booleanisTokenLockProvided()true if [EDITEDBY]-option set.booleannoModelDefaults()Returns whether global model defaults should be applied or not.booleanprocessSorting(java.lang.String token)Checks that the sorting string starts with a + or -.voidsetEditedByProvided(boolean tokenLockProvided)voidsetNoModelDefaults(boolean noModelDefaults)voidsetNoPrimaryKey(boolean noPrimary)voidsetNormTextProvided(boolean normText)voidsetRemote(boolean remote)voidsetRootClassIdProvided(boolean rootClassId)voidsetRootEntity(boolean rootEntity)voidsetRootIdProvided(boolean rootId)voidsetTableSerialProvided(boolean tableSerial)voidsetTrackType(TrackType trackType)-
Methods inherited from class org.tentackle.model.impl.CommonOptionsImpl
addBindOption, createModelException, getAccessScope, getBindOptions, getComment, getSourceInfo, isAutoSelect, isBind, isDerived, isFromSuper, isLowerCase, isMapNull, isMaxCol, isNoConstant, isNoDeclare, isNoMethod, isReadOnly, isSetGet, isTrimRead, isTrimWrite, isUpperCase, isWriteOnly, processBindOption, processOption, removeBindOption, setAccessScope, setAutoSelect, setBind, setBindOptions, setComment, setDerived, setFromSuper, setLowerCase, setMapNull, setMaxCol, setNoConstant, setNoDeclare, setNoMethod, setReadOnly, setSetGet, setTrimRead, setTrimWrite, setUpperCase, setWriteOnly, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.tentackle.model.CommonOptions
getAccessScope, getBindOptions, getComment, isAutoSelect, isBind, isDerived, isFromSuper, isLowerCase, isMapNull, isMaxCol, isNoConstant, isNoDeclare, isNoMethod, isReadOnly, isSetGet, isTrimRead, isTrimWrite, isUpperCase, isWriteOnly, validate
-
-
-
-
Field Detail
-
OPTION_NO_MODELDEFAULTS
public static final java.lang.String OPTION_NO_MODELDEFAULTS
don't apply model defaults.- See Also:
- Constant Field Values
-
OPTION_NO_PRIMARY
public static final java.lang.String OPTION_NO_PRIMARY
don't generate ID as primary key.- See Also:
- Constant Field Values
-
OPTION_TABLESERIAL
public static final java.lang.String OPTION_TABLESERIAL
column tableserial is provided.- See Also:
- Constant Field Values
-
OPTION_TOKENLOCK
public static final java.lang.String OPTION_TOKENLOCK
token lock columns editedBy/Since/Expiry are provided.- See Also:
- Constant Field Values
-
OPTION_NORMTEXT
public static final java.lang.String OPTION_NORMTEXT
normText is provided.- See Also:
- Constant Field Values
-
OPTION_ROOT
public static final java.lang.String OPTION_ROOT
root entity.- See Also:
- Constant Field Values
-
OPTION_ROOTID
public static final java.lang.String OPTION_ROOTID
rootid is provided.- See Also:
- Constant Field Values
-
OPTION_ROOTCLASSID
public static final java.lang.String OPTION_ROOTCLASSID
rootclassid is provided.- See Also:
- Constant Field Values
-
OPTION_REMOTE
public static final java.lang.String OPTION_REMOTE
enable remoting.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EntityOptionsImpl
public EntityOptionsImpl(EntityFactory factory, Entity entity, SourceInfo sourceInfo)
Creates entity options.- Parameters:
factory- the factoryentity- the entity the options belong tosourceInfo- the source info
-
-
Method Detail
-
getEntity
public Entity getEntity()
Description copied from interface:EntityOptionsGets the entity this option-set belongs to.- Specified by:
getEntityin interfaceEntityOptions- Returns:
- the entity
-
noModelDefaults
public boolean noModelDefaults()
Description copied from interface:EntityOptionsReturns whether global model defaults should be applied or not.- Specified by:
noModelDefaultsin interfaceEntityOptions- Returns:
- true if ignore model defaults completely
-
applyOption
public boolean applyOption(java.lang.String option, java.lang.Boolean ctrl) throws ModelExceptionDescription copied from class:CommonOptionsImplApplies given option string.- Overrides:
applyOptionin classCommonOptionsImpl- Parameters:
option- the option stringctrl- option control: true if turn option on, false if oprion off, null if on/off missing (defaults to on)- Returns:
- true if applied, false if unknown option
- Throws:
ModelException- if applying the option failed
-
processSorting
public boolean processSorting(java.lang.String token)
Checks that the sorting string starts with a + or -.- Parameters:
token- the sorting token- Returns:
- true if applied
-
isNoPrimaryKey
public boolean isNoPrimaryKey()
Description copied from interface:EntityOptionstrue if [NOPKEY]-option set.- Specified by:
isNoPrimaryKeyin interfaceEntityOptions- Returns:
- the NoPrimary
-
getTrackType
public TrackType getTrackType()
Description copied from interface:EntityOptionsGets the tracking type.- Specified by:
getTrackTypein interfaceEntityOptions- Returns:
- the tracking type
-
isTableSerialProvided
public boolean isTableSerialProvided()
Description copied from interface:EntityOptionstrue if [TABLESERIAL]-option set.- Specified by:
isTableSerialProvidedin interfaceEntityOptions- Returns:
- true if tableserial column provided
-
isTokenLockProvided
public boolean isTokenLockProvided()
Description copied from interface:EntityOptionstrue if [EDITEDBY]-option set.- Specified by:
isTokenLockProvidedin interfaceEntityOptions- Returns:
- truf if editedby token columns provided
-
isNormTextProvided
public boolean isNormTextProvided()
Description copied from interface:EntityOptionstrue if [NORMTEXT]-option set.- Specified by:
isNormTextProvidedin interfaceEntityOptions- Returns:
- true if normtext column provided
-
isRoot
public boolean isRoot()
Description copied from interface:EntityOptionstrue if [ROOT]-option set- Specified by:
isRootin interfaceEntityOptions- Returns:
- true if this is a root entity
-
isRootIdProvided
public boolean isRootIdProvided()
Description copied from interface:EntityOptionstrue if [ROOTID]-option set.- Specified by:
isRootIdProvidedin interfaceEntityOptions- Returns:
- true if rootid column provided
-
isRootClassIdProvided
public boolean isRootClassIdProvided()
Description copied from interface:EntityOptionstrue if [ROOTCLASSID]-option set.- Specified by:
isRootClassIdProvidedin interfaceEntityOptions- Returns:
- true if rootclassid column provided
-
isRemote
public boolean isRemote()
Description copied from interface:EntityOptionsReturns whether entity supports remoting.- Specified by:
isRemotein interfaceEntityOptions- Returns:
- true if with remoting, false if only local
-
getSorting
public java.util.List<java.lang.String> getSorting()
Description copied from interface:EntityOptionsGets the default sorting options.- Specified by:
getSortingin interfaceEntityOptions- Returns:
- the default sorting, null if none
-
setNoModelDefaults
public void setNoModelDefaults(boolean noModelDefaults)
-
setTrackType
public void setTrackType(TrackType trackType)
-
setEditedByProvided
public void setEditedByProvided(boolean tokenLockProvided)
-
setNormTextProvided
public void setNormTextProvided(boolean normText)
-
setNoPrimaryKey
public void setNoPrimaryKey(boolean noPrimary)
-
setTableSerialProvided
public void setTableSerialProvided(boolean tableSerial)
-
setRootEntity
public void setRootEntity(boolean rootEntity)
-
setRootIdProvided
public void setRootIdProvided(boolean rootId)
-
setRootClassIdProvided
public void setRootClassIdProvided(boolean rootClassId)
-
setRemote
public void setRemote(boolean remote)
-
-