Class SFieldScalar

java.lang.Object
simpleorm.dataset.SFieldMeta
simpleorm.dataset.SFieldScalar
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SFieldBigDecimal, SFieldBlob, SFieldBoolean, SFieldBytes, SFieldDate, SFieldDouble, SFieldEnum, SFieldInteger, SFieldLong, SFieldObject, SFieldString, SFieldTime, SFieldTimestamp

public abstract class SFieldScalar extends SFieldMeta
Scalar fields such as String, Int, but not References to other tables. Only scalars are actually stored in tables. It is scalars that are marked as primary keys etc.
See Also:
  • Field Details

    • sqlDataTypeOverride

      public String sqlDataTypeOverride
    • theGenerator

      public Object theGenerator
  • Constructor Details

  • Method Details

    • overrideSqlDataType

      public <T extends SFieldScalar> T overrideSqlDataType(String dataType)
      If set, this overrides the entire column data type string generated in the CREATE TABLE string
    • defaultSqlDataType

      public abstract String defaultSqlDataType()
      The default data type if not overriden by overrideSqlDataType. This is only called when the data type is actually needed by CREATE TABLE, ie if no sqlDataTypeOverride is specified.
    • javaSqlType

      public abstract int javaSqlType()
      Returns:
      int constant from java.sql.Types, used for setting sql datatype with null values
    • isMandatory

      public boolean isMandatory()
      Overrides:
      isMandatory in class SFieldMeta
    • isGenerated

      public boolean isGenerated()
    • isPrimary

      public boolean isPrimary()
    • isNotOptimisticLocked

      public boolean isNotOptimisticLocked()
    • getColumnName

      public String getColumnName()
      The column name, which for now is the same as the field name but that may change.
    • getReferences

      protected List<SFieldReference> getReferences()
    • toLongerString

      public String toLongerString()
      Description copied from class: SFieldMeta
      Lists all the details of the field.
      Specified by:
      toLongerString in class SFieldMeta
    • isForeignKey

      public boolean isForeignKey()
      Is this field part of at least one forign key ?
      Overrides:
      isForeignKey in class SFieldMeta
    • setGeneratorMode

      public <T extends SFieldScalar> T setGeneratorMode(SGeneratorMode gen, Object... gParams)
      Sets the generator associated to this field. This will make the field generated, reference the generator for future use and **remove any NotNullValidaotr*** (so if you want to add one, do it after you call setGenerator)
    • getGeneratorMode

      public SGeneratorMode getGeneratorMode()
    • getGeneratorParameter

      public Object[] getGeneratorParameter()
    • getTheGenerator

      public Object getTheGenerator()
    • setTheGenerator

      public void setTheGenerator(Object theGenerator)
    • setMaxSize

      protected void setMaxSize(int maxSize)
    • getMaxSize

      public int getMaxSize()