java.lang.Object
org.tentackle.model.impl.CommonOptionsImpl
org.tentackle.model.impl.EntityOptionsImpl
- All Implemented Interfaces:
Cloneable,CommonOptions,EntityOptions
Entity options.
- Author:
- harald
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringentity provides a cache.static final Stringdon't apply model defaults.static final Stringdon't generate ID as primary key.static final StringnormText is provided.static final Stringentity provided by externally.static final Stringenable remoting.static final Stringroot entity.static final Stringrootclassid is provided.static final Stringrootid is provided.static final Stringcolumn tableserial is provided.static final Stringtoken lock columns editedBy/Since/Expiry are provided.Fields inherited from class org.tentackle.model.impl.CommonOptionsImpl
BIND_SIZE, OPTION_BIND, OPTION_MAPNULL, OPTION_MUTE, OPTION_NOCONSTANT, OPTION_NODECLARE, OPTION_NOMETHOD, OPTION_READONLY, OPTION_SUPER, OPTION_TRIM, OPTION_TRIM_READ, OPTION_TRIM_WRITE, OPTION_WRITEONLY -
Constructor Summary
ConstructorsConstructorDescriptionEntityOptionsImpl(EntityFactory factory, Entity entity, SourceInfo sourceInfo) Creates entity options. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyOption(String option, Boolean ctrl) Applies given option string.protected EntityOptionsImplclone()Clones the entity options.
The method is protected, sinceclone(EntityImpl)should be used instead, which invokesclone().clone(EntityImpl entity) Clones options for another entity instance.Gets the entity this option-set belongs to.Gets the default sorting options.Gets the tracking type.booleanisCached()Returns whether the entity provides a cache.
Only applicable to root entities.booleantrue if [NOPKEY]-option set.booleantrue if [NORMTEXT]-option set.booleanReturns whether the DDL of this entity is maintained by another application.
Provided entities are ignored by the tentackle-sql maven plugin and no SQL-code will be generated at all, neither for create nor any migration.booleanisRemote()Returns whether entity supports remoting.booleanisRoot()true if [ROOT]-option setbooleantrue if [ROOTCLASSID]-option set.booleantrue if [ROOTID]-option set.booleantrue if [TABLESERIAL]-option set.booleantrue if [TOKENLOCK]-option set.booleanReturns whether global model defaults should be applied or not.booleanprocessSorting(String token) Checks that the sorting string starts with a + or -.voidsetCached(boolean cached) voidsetNoModelDefaults(boolean noModelDefaults) voidsetNoPrimaryKey(boolean noPrimary) voidsetNormTextProvided(boolean normText) voidsetProvided(boolean provided) voidsetRemote(boolean remote) voidsetRootClassIdProvided(boolean rootClassId) voidsetRootEntity(boolean rootEntity) voidsetRootIdProvided(boolean rootId) voidsetTableSerialProvided(boolean tableSerial) voidsetTokenLockProvided(boolean tokenLockProvided) voidsetTrackType(TrackType trackType) Methods inherited from class org.tentackle.model.impl.CommonOptionsImpl
addBindOption, createModelException, getAccessScope, getBindOptions, getComment, getSourceInfo, getStereotypes, isAutoSelect, isBindable, isFromSuper, isLowerCase, isMapNull, isMaxCol, isMute, isNoConstant, isNoDeclare, isNoMethod, isReadOnly, isTrimRead, isTrimWrite, isUpperCase, isWriteOnly, processBindOption, processOption, removeBindOption, setAccessScope, setAutoSelect, setBindable, setBindOptions, setComment, setFromSuper, setLowerCase, setMapNull, setMaxCol, setMute, setNoConstant, setNoDeclare, setNoMethod, setReadOnly, setStereotypes, setTrimRead, setTrimWrite, setUpperCase, setWriteOnly, validateMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tentackle.model.CommonOptions
getAccessScope, getBindOptions, getComment, getStereotypes, isAutoSelect, isBindable, isFromSuper, isLowerCase, isMapNull, isMaxCol, isMute, isNoConstant, isNoDeclare, isNoMethod, isReadOnly, isTrimRead, isTrimWrite, isUpperCase, isWriteOnly, validate
-
Field Details
-
OPTION_NO_MODELDEFAULTS
don't apply model defaults.- See Also:
-
OPTION_NO_PRIMARY
don't generate ID as primary key.- See Also:
-
OPTION_TABLESERIAL
column tableserial is provided.- See Also:
-
OPTION_TOKENLOCK
token lock columns editedBy/Since/Expiry are provided.- See Also:
-
OPTION_NORMTEXT
normText is provided.- See Also:
-
OPTION_ROOT
root entity.- See Also:
-
OPTION_ROOTID
rootid is provided.- See Also:
-
OPTION_ROOTCLASSID
rootclassid is provided.- See Also:
-
OPTION_REMOTE
enable remoting.- See Also:
-
OPTION_PROVIDED
entity provided by externally.- See Also:
-
OPTION_CACHED
entity provides a cache.- See Also:
-
-
Constructor Details
-
EntityOptionsImpl
Creates entity options.- Parameters:
factory- the factoryentity- the entity the options belong tosourceInfo- the source info
-
-
Method Details
-
clone
Clones the entity options.
The method is protected, sinceclone(EntityImpl)should be used instead, which invokesclone().- Overrides:
clonein classCommonOptionsImpl- Returns:
- the cloned options
-
clone
Clones options for another entity instance.- Parameters:
entity- the entity- Returns:
- the options
-
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
Description copied from class:CommonOptionsImplApplies given option string.- Overrides:
applyOptionin classCommonOptionsImpl- Parameters:
option- the option stringctrl- option control: true if turn option on, false if option 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
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
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 [TOKENLOCK]-option set.- Specified by:
isTokenLockProvidedin interfaceEntityOptions- Returns:
- true if token-lock 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
-
isProvided
public boolean isProvided()Description copied from interface:EntityOptionsReturns whether the DDL of this entity is maintained by another application.
Provided entities are ignored by the tentackle-sql maven plugin and no SQL-code will be generated at all, neither for create nor any migration.- Specified by:
isProvidedin interfaceEntityOptions- Returns:
- true if provided
-
isCached
public boolean isCached()Description copied from interface:EntityOptionsReturns whether the entity provides a cache.
Only applicable to root entities.- Specified by:
isCachedin interfaceEntityOptions- Returns:
- true if cached
-
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
-
setTokenLockProvided
public void setTokenLockProvided(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) -
setProvided
public void setProvided(boolean provided) -
setCached
public void setCached(boolean cached)
-