Class EntityOptionsImpl

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 Details

  • Constructor Details

    • EntityOptionsImpl

      public EntityOptionsImpl(EntityFactory factory, Entity entity, SourceInfo sourceInfo)
      Creates entity options.
      Parameters:
      factory - the factory
      entity - the entity the options belong to
      sourceInfo - the source info
  • Method Details

    • getEntity

      public Entity getEntity()
      Description copied from interface: EntityOptions
      Gets the entity this option-set belongs to.
      Specified by:
      getEntity in interface EntityOptions
      Returns:
      the entity
    • noModelDefaults

      public boolean noModelDefaults()
      Description copied from interface: EntityOptions
      Returns whether global model defaults should be applied or not.
      Specified by:
      noModelDefaults in interface EntityOptions
      Returns:
      true if ignore model defaults completely
    • applyOption

      public boolean applyOption(String option, Boolean ctrl) throws ModelException
      Description copied from class: CommonOptionsImpl
      Applies given option string.
      Overrides:
      applyOption in class CommonOptionsImpl
      Parameters:
      option - the option string
      ctrl - 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(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: EntityOptions
      true if [NOPKEY]-option set.
      Specified by:
      isNoPrimaryKey in interface EntityOptions
      Returns:
      the NoPrimary
    • getTrackType

      public TrackType getTrackType()
      Description copied from interface: EntityOptions
      Gets the tracking type.
      Specified by:
      getTrackType in interface EntityOptions
      Returns:
      the tracking type
    • isTableSerialProvided

      public boolean isTableSerialProvided()
      Description copied from interface: EntityOptions
      true if [TABLESERIAL]-option set.
      Specified by:
      isTableSerialProvided in interface EntityOptions
      Returns:
      true if tableserial column provided
    • isTokenLockProvided

      public boolean isTokenLockProvided()
      Description copied from interface: EntityOptions
      true if [EDITEDBY]-option set.
      Specified by:
      isTokenLockProvided in interface EntityOptions
      Returns:
      truf if editedby token columns provided
    • isNormTextProvided

      public boolean isNormTextProvided()
      Description copied from interface: EntityOptions
      true if [NORMTEXT]-option set.
      Specified by:
      isNormTextProvided in interface EntityOptions
      Returns:
      true if normtext column provided
    • isRoot

      public boolean isRoot()
      Description copied from interface: EntityOptions
      true if [ROOT]-option set
      Specified by:
      isRoot in interface EntityOptions
      Returns:
      true if this is a root entity
    • isRootIdProvided

      public boolean isRootIdProvided()
      Description copied from interface: EntityOptions
      true if [ROOTID]-option set.
      Specified by:
      isRootIdProvided in interface EntityOptions
      Returns:
      true if rootid column provided
    • isRootClassIdProvided

      public boolean isRootClassIdProvided()
      Description copied from interface: EntityOptions
      true if [ROOTCLASSID]-option set.
      Specified by:
      isRootClassIdProvided in interface EntityOptions
      Returns:
      true if rootclassid column provided
    • isRemote

      public boolean isRemote()
      Description copied from interface: EntityOptions
      Returns whether entity supports remoting.
      Specified by:
      isRemote in interface EntityOptions
      Returns:
      true if with remoting, false if only local
    • isProvided

      public boolean isProvided()
      Description copied from interface: EntityOptions
      Returns 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:
      isProvided in interface EntityOptions
      Returns:
      true if provided
    • isCached

      public boolean isCached()
      Description copied from interface: EntityOptions
      Returns whether the entity provides a cache.
      Only applicable to root entities.
      Specified by:
      isCached in interface EntityOptions
      Returns:
      true if cached
    • getSorting

      public List<String> getSorting()
      Description copied from interface: EntityOptions
      Gets the default sorting options.
      Specified by:
      getSorting in interface EntityOptions
      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)
    • setProvided

      public void setProvided(boolean provided)
    • setCached

      public void setCached(boolean cached)