程序包 gu.sql2java

类 BaseRow

java.lang.Object
gu.sql2java.BaseRow
所有已实现的接口:
BaseBean, Cloneable, Comparable<BaseRow>
直接已知子类:
UnnameRow

public abstract class BaseRow extends Object implements BaseBean, Comparable<BaseRow>, Cloneable
abstract implementation of BaseBean
作者:
guyadong
  • 字段详细资料

  • 构造器详细资料

    • BaseRow

      protected BaseRow(RowMetaData metaData)
    • BaseRow

      protected BaseRow()
  • 方法详细资料

    • isInitialized

      public final boolean isInitialized(String column)
      从接口复制的说明: BaseBean
      Determines if the column has been initialized.
      It is useful to determine if a field is null on purpose or just because it has not been initialized.
      指定者:
      isInitialized 在接口中 BaseBean
      参数:
      column - column name
      返回:
      true if the field has been initialized, false otherwise
    • beModified

      public boolean beModified()
      从接口复制的说明: BaseBean
      Determines if the object has been modified since the last time this method was called.
      We can also determine if this object has ever been modified since its creation.
      指定者:
      beModified 在接口中 BaseBean
      返回:
      true if the object has been modified, false if the object has not been modified
    • isModified

      public boolean isModified(int... columnIDs)
      从接口复制的说明: BaseBean
      Determines if the columnIDs has been modified.
      指定者:
      isModified 在接口中 BaseBean
      参数:
      columnIDs - column id array
      返回:
      true if any field has been modified, otherwise false
    • isModified

      public boolean isModified(String... columns)
      从接口复制的说明: BaseBean
      Determines if the columns has been modified.
      指定者:
      isModified 在接口中 BaseBean
      参数:
      columns - column name array
      返回:
      true if any field has been modified, , otherwise false
    • isModified

      public boolean isModified(String column)
      从接口复制的说明: BaseBean
      Determines if the column has been modified.
      指定者:
      isModified 在接口中 BaseBean
      参数:
      column - column name
      返回:
      true if the field has been modified, false if the field has not been modified
    • isModifiedNested

      public boolean isModifiedNested(String nestedName)
      从接口复制的说明: BaseBean
      Determines if the nestedName has been modified.
      指定者:
      isModifiedNested 在接口中 BaseBean
      参数:
      nestedName - nest name start with [tablename.]column name, splitted with '.'
      返回:
      true if the field has been modified, false if the field has not been modified
    • modifiedColumnIDs

      public int[] modifiedColumnIDs()
      指定者:
      modifiedColumnIDs 在接口中 BaseBean
      返回:
      modified column id list or empyt array if none column be modified
    • modifiedColumns

      public String[] modifiedColumns()
      指定者:
      modifiedColumns 在接口中 BaseBean
      返回:
      modified column name list or empyt array if none column be modified
    • modifiedColumnCount

      public int modifiedColumnCount()
      指定者:
      modifiedColumnCount 在接口中 BaseBean
      返回:
      modified column count
    • modified

      public void modified(int[] columnIDs)
      从接口复制的说明: BaseBean
      set the object modification status to 'modified' and initialization status to 'initialized'
      指定者:
      modified 在接口中 BaseBean
      参数:
      columnIDs - column id array,ignore if null
    • modified

      public void modified(int columnID, int... columnIDs)
      从接口复制的说明: BaseBean
      set the object modification status to 'modified' and initialization status to 'initialized'
      指定者:
      modified 在接口中 BaseBean
      参数:
      columnID - column id
      columnIDs - column id array,ignore if null
    • modified

      public void modified(String column)
      从接口复制的说明: BaseBean
      set the object modification status to 'modified' and initialization status to 'initialized'
      指定者:
      modified 在接口中 BaseBean
      参数:
      column - column name
    • modified

      public void modified(String[] columns)
      从接口复制的说明: BaseBean
      set the object modification status to 'modified' and initialization status to 'initialized'
      指定者:
      modified 在接口中 BaseBean
      参数:
      columns - column name array,ignore if null
    • modified

      public void modified(String column, String... columns)
      从接口复制的说明: BaseBean
      set the object modification status to 'modified' and initialization status to 'initialized'
      指定者:
      modified 在接口中 BaseBean
      参数:
      column - column name
      columns - column name array,ignore if null
    • resetModified

      public void resetModified(int[] columnIDs)
      从接口复制的说明: BaseBean
      reset columns modification status defined by columnIDs
      指定者:
      resetModified 在接口中 BaseBean
      参数:
      columnIDs - column id array,ignore if null
    • resetModified

      public void resetModified(int columnID, int... columnIDs)
      从接口复制的说明: BaseBean
      reset columns modification status defined by columnID,columnIDs
      指定者:
      resetModified 在接口中 BaseBean
      参数:
      columnID - column id
      columnIDs - column id array,ignore if null
    • resetModified

      public void resetModified(String column)
      从接口复制的说明: BaseBean
      reset columns modification status defined by column
      指定者:
      resetModified 在接口中 BaseBean
      参数:
      column - column name
    • resetModified

      public void resetModified(String column, String... columns)
      从接口复制的说明: BaseBean
      reset columns modification status defined by column,columns
      指定者:
      resetModified 在接口中 BaseBean
      参数:
      column - column name
      columns - column name array,ignore if null
    • resetModified

      public void resetModified(String[] columns)
      从接口复制的说明: BaseBean
      reset columns modification status defined by columns
      指定者:
      resetModified 在接口中 BaseBean
      参数:
      columns - column name array,ignore if null
    • resetModifiedIfEqual

      public void resetModifiedIfEqual()
      从接口复制的说明: BaseBean
      Read record (old record) from the database based on the primary key, compare all modified fields in the current bean with the corresponding fields of the old record, and if equal (deep equals), reset the bit corresponding of the modified field
      Note: This method can only be used on (local) server side
      指定者:
      resetModifiedIfEqual 在接口中 BaseBean
    • loadByPk

      public <B extends BaseBean> B loadByPk()
      try retrieving the corresponding record based on the primary key(has no null) and return it. Otherwise, return null
      only run on database service side
      从以下版本开始:
      4.3.4
    • loadSaved

      public <B extends BaseBean> B loadSaved()
      If BaseBean.isNew() is false, try retrieving the corresponding record based on the primary key and return it. Otherwise, return null
      only run on database service side
      从以下版本开始:
      3.32.6
    • resetPrimaryKeysModified

      public void resetPrimaryKeysModified()
      从接口复制的说明: BaseBean
      Resets the primary keys modification status to 'not modified'.
      指定者:
      resetPrimaryKeysModified 在接口中 BaseBean
    • resetModifiedExceptPrimaryKeys

      public void resetModifiedExceptPrimaryKeys()
      从接口复制的说明: BaseBean
      Resets columns modification status except primary keys to 'not modified'.
      指定者:
      resetModifiedExceptPrimaryKeys 在接口中 BaseBean
    • getValue

      public final <T> T getValue(String column)
      指定者:
      getValue 在接口中 BaseBean
      参数:
      column - column name
      返回:
      return a object representation of the given field
    • getValueChecked

      public final <T> T getValueChecked(int columnID)
      指定者:
      getValueChecked 在接口中 BaseBean
      参数:
      columnID - column id
      返回:
      return a object representation of the given column id or throw NullPointerException if value is null
    • getValueChecked

      public final <T> T getValueChecked(String column)
      指定者:
      getValueChecked 在接口中 BaseBean
      参数:
      column - column name
      返回:
      return a object representation of the given field or throw NullPointerException if value is null
    • setValue

      public final void setValue(String column, Object value)
      从接口复制的说明: BaseBean
      set a value representation of the given field
      指定者:
      setValue 在接口中 BaseBean
      参数:
      column - column name
    • setValueIfNonNull

      public final boolean setValueIfNonNull(String column, Object value)
      从接口复制的说明: BaseBean
      set a value representation of the given field if value is not null
      指定者:
      setValueIfNonNull 在接口中 BaseBean
      参数:
      column - column name
      返回:
      true if not null,otherwise false
    • setValueIfNonEqual

      public final boolean setValueIfNonEqual(String column, Object value)
      从接口复制的说明: BaseBean
      set a value representation of the given field if value is not equal with old
      指定者:
      setValueIfNonEqual 在接口中 BaseBean
      参数:
      column - column name
      返回:
      true if not equal,otherwise false
    • setValueIf

      public final boolean setValueIf(boolean expression, String column, Object value)
      从接口复制的说明: BaseBean
      set a value representation of the given field if expression is true
      指定者:
      setValueIf 在接口中 BaseBean
      参数:
      column - column name
      返回:
      expression always
    • getValue

      public <T> T getValue(int columnID)
      指定者:
      getValue 在接口中 BaseBean
      参数:
      columnID - column id
      返回:
      return a object representation of the given column id
    • getOriginValue

      public <T> T getOriginValue(int columnID)
      指定者:
      getOriginValue 在接口中 BaseBean
      参数:
      columnID - column id
      返回:
      return a origin object representation of the given column id
    • getJdbcValue

      public <T> T getJdbcValue(int columnID)
      指定者:
      getJdbcValue 在接口中 BaseBean
      返回:
      return a value as JDBC store type representation of the given column id
    • setValue

      public <T> void setValue(int columnID, T value)
      从接口复制的说明: BaseBean
      set a value representation of the given column id
      指定者:
      setValue 在接口中 BaseBean
      参数:
      columnID - column id
    • setValueIfNonNull

      public final <T> boolean setValueIfNonNull(int columnID, T value)
      从接口复制的说明: BaseBean
      set a value representation of the given column id if value is not null
      指定者:
      setValueIfNonNull 在接口中 BaseBean
      参数:
      columnID - column id
      返回:
      true if not null,otherwise false
    • setValueIfNonEqual

      public final <T> boolean setValueIfNonEqual(int columnID, T value)
      从接口复制的说明: BaseBean
      set a value representation of the given column id if value is not equal with old
      指定者:
      setValueIfNonEqual 在接口中 BaseBean
      参数:
      columnID - column id
      返回:
      true if not equal,otherwise false
    • setValueIf

      public final <T> boolean setValueIf(boolean expression, int columnID, T value)
      从接口复制的说明: BaseBean
      set a value representation of the given column id if expression is true
      指定者:
      setValueIf 在接口中 BaseBean
      参数:
      columnID - column id
      返回:
      expression always
    • testBitValue

      public final boolean testBitValue(int columnID, Number mask, boolean bitOr)
      从接口复制的说明: BaseBean
      Test integral fields with bits specified by the mask
      指定者:
      testBitValue 在接口中 BaseBean
      参数:
      columnID - column id
      mask - integral type required(Long|Integer|Short|Byte)
      返回:
      column&mask != 0 if bitOr is true otherwise column&mask == mask
    • testBitValue

      public final boolean testBitValue(String column, Number mask, boolean bitOr)
      从接口复制的说明: BaseBean
      Test integral fields with bits specified by the mask
      指定者:
      testBitValue 在接口中 BaseBean
      参数:
      column - column name
      mask - integral type required(Long|Integer|Short|Byte)
      返回:
      column&mask != 0 if bitOr is true otherwise column&mask == mask
    • getBitValue

      public final <T extends Number> T getBitValue(int columnID, Number mask)
      指定者:
      getBitValue 在接口中 BaseBean
      参数:
      columnID - column id
      mask - integral type required(Long|Integer|Short|Byte)
      返回:
      Returns not null integral value of the bit specified by the mask mask of the integral field specified by columnID
    • getBitValue

      public final <T extends Number> T getBitValue(String column, Number mask)
      指定者:
      getBitValue 在接口中 BaseBean
      参数:
      column - column name
      mask - integral type required(Long|Integer|Short|Byte)
      返回:
      Returns not null integral value of the bit specified by the mask mask of the integral field
    • setBitValue

      public final void setBitValue(int columnID, Number mask, boolean bitSet)
      从接口复制的说明: BaseBean
      Set the mask value of the integral field specified by columnID and the value of the bit specified by the mask
      指定者:
      setBitValue 在接口中 BaseBean
      参数:
      columnID - column id
      mask - integral type required(Long|Integer|Short|Byte)
      bitSet - set bit to 1 if true,otherwise set bit to 0
    • setBitValue

      public final void setBitValue(String column, Number mask, boolean bitSet)
      从接口复制的说明: BaseBean
      Set the mask value of the integral field specified by column and the value of the bit specified by the mask
      指定者:
      setBitValue 在接口中 BaseBean
      参数:
      column - column name
      mask - integral type required(Long|Integer|Short|Byte)
      bitSet - set bit to 1 if true,otherwise set bit to 0
    • setBitValueIfNonNull

      public final boolean setBitValueIfNonNull(String column, Number mask, boolean bitSet)
      从接口复制的说明: BaseBean
      Set the mask value of the integral field specified by column and the value of the bit specified by the mask if mask and old value is not null
      指定者:
      setBitValueIfNonNull 在接口中 BaseBean
      参数:
      column - column name
      mask - integral type required(Long|Integer|Short|Byte)
      bitSet - set bit to 1 if true,otherwise set bit to 0
    • setBitValueIf

      public final boolean setBitValueIf(boolean expression, String column, Number mask, boolean bitSet)
      从接口复制的说明: BaseBean
      Set the mask value of the integral field specified by column and the value of the bit specified by the mask if expression is true
      指定者:
      setBitValueIf 在接口中 BaseBean
      参数:
      column - column name
      mask - integral type required(Long|Integer|Short|Byte)
      bitSet - set bit to 1 if true,otherwise set bit to 0
    • primaryValues

      public Object[] primaryValues()
      指定者:
      primaryValues 在接口中 BaseBean
      返回:
      values array for all primary key, empty array if no primary key
    • primaryValue

      public <T> T primaryValue()
      指定者:
      primaryValue 在接口中 BaseBean
      类型参数:
      T - PK type
      返回:
      value for primary key, throw UnsupportedOperationException if there is more than one primary key
    • asValueArray

      public Object[] asValueArray(int... columnIds)
      指定者:
      asValueArray 在接口中 BaseBean
      参数:
      columnIds - column id that will be output, if null or empty,output all columns
      返回:
      values array for all fields
    • asNameValueMap

      public Map<String,Object> asNameValueMap()
      从接口复制的说明: BaseBean
      view of values map for all fields, column name -- value
      指定者:
      asNameValueMap 在接口中 BaseBean
    • asNameValueMap

      public Map<String,Object> asNameValueMap(boolean ignoreNull, String... ignoreColumns)
      指定者:
      asNameValueMap 在接口中 BaseBean
      参数:
      ignoreNull - remove all null column
      ignoreColumns - remove column name list
      返回:
      values map for all fields, column name -- value
    • asNameValueMap

      public Map<String,Object> asNameValueMap(boolean ignoreNull, Iterable<String> ignoreColumns)
      指定者:
      asNameValueMap 在接口中 BaseBean
      参数:
      ignoreNull - remove all null column
      ignoreColumns - remove column name list
      返回:
      values map for all fields, column name -- value
    • asNameValueMap

      public Map<String,Object> asNameValueMap(boolean ignoreNull, boolean include, String... includeColumns)
      指定者:
      asNameValueMap 在接口中 BaseBean
      参数:
      ignoreNull - remove all null column
      include - if true,the columns is white list(include) for column, only output columns which in list,otherwise it's black list(exclude)
      includeColumns - remove column name list
      返回:
      values map for all fields, column name -- value
    • asNameValueMap

      public Map<String,Object> asNameValueMap(boolean ignoreNull, boolean include, Iterable<String> columns)
      指定者:
      asNameValueMap 在接口中 BaseBean
      参数:
      ignoreNull - remove all null column
      include - if true,the columns is white list(include) for column, only output columns which in list,otherwise it's black list(exclude)
      columns - column name list for white/black(include/exclude) list
      返回:
      values map for all fields, column name -- value
    • asNameValueMap

      public Map<String,Object> asNameValueMap(boolean ignoreNull, boolean serialize, boolean include, String... includeColumns)
      指定者:
      asNameValueMap 在接口中 BaseBean
      参数:
      ignoreNull - remove all null column
      serialize - serialize field if exist annotation JSONField and specialize serialized class
      include - if true,the columns is white list(include) for column, only output columns which in list,otherwise it's black list(exclude)
      includeColumns - remove column name list
      返回:
      values map for all fields, column name -- value
    • asNameValueMap

      public Map<String,Object> asNameValueMap(boolean ignoreNull, boolean serialize, boolean include, Iterable<String> columns)
      指定者:
      asNameValueMap 在接口中 BaseBean
      参数:
      ignoreNull - remove all null column
      serialize - serialize field if exist annotation JSONField and specialize serialized class
      include - if true,the columns is white list(include) for column, only output columns which in list,otherwise it's black list(exclude)
      columns - column name list for white/black(include/exclude) list
      返回:
      values map for all fields, column name -- value
    • asFilterableNameValueMap

      public Map<String,Object> asFilterableNameValueMap()
      从接口复制的说明: BaseBean
      Return the column name -- value mapping that filtered by beanfilter
      指定者:
      asFilterableNameValueMap 在接口中 BaseBean
    • copy

      public <B extends BaseBean> B copy(B bean)
      从接口复制的说明: BaseBean
      Copies the passed bean into the current bean.
      指定者:
      copy 在接口中 BaseBean
      参数:
      bean - the bean to copy into the current bean
      返回:
      this bean
    • copy

      public <B extends BaseBean> B copy(B bean, int... fieldList)
      从接口复制的说明: BaseBean
      Copies the passed bean into the current bean.
      指定者:
      copy 在接口中 BaseBean
      参数:
      bean - the bean to copy into the current bean
      fieldList - the column id list to copy into the current bean,if null or empty,copy all fields
      返回:
      always this bean
    • copy

      public <B extends BaseBean> B copy(B bean, String... fieldList)
      从接口复制的说明: BaseBean
      Copies the passed bean into the current bean.
      指定者:
      copy 在接口中 BaseBean
      参数:
      bean - the bean to copy into the current bean
      fieldList - the column name list to copy into the current bean
      返回:
      always this bean
    • copy

      public <B extends BaseBean> B copy(B bean, com.google.common.base.Predicate<Integer> fieldFilter, int... fieldList)
      从接口复制的说明: BaseBean
      Copies the passed bean into the current bean.
      指定者:
      copy 在接口中 BaseBean
      参数:
      bean - the bean to copy into the current bean
      fieldFilter - the filter for column name,ignore if null
      fieldList - the column id list to copy into the current bean
      返回:
      always this bean
    • copy

      public <B extends BaseBean> B copy(B bean, com.google.common.base.Predicate<String> fieldFilter, String... fieldList)
      从接口复制的说明: BaseBean
      Copies the passed bean into the current bean.
      指定者:
      copy 在接口中 BaseBean
      参数:
      bean - the bean to copy into the current bean
      fieldFilter - the filter for column name,ignore if null
      fieldList - the column name list to copy into the current bean
      返回:
      always this bean
    • copyIfNonEqual

      public <B extends BaseBean> B copyIfNonEqual()
      从接口复制的说明: BaseBean
      Read record (old record) from the database based on the primary key, copy all fields of the current object that are be modified and different from the old record, and return the updated old record.
      Note: This method can only be used on (local) server side
      指定者:
      copyIfNonEqual 在接口中 BaseBean
      返回:
      If BaseBean.isNew() is true or the current object is not a BaseRow instance, return the current object
    • copy

      public <B extends BaseBean, F extends BaseBean> B copy(F from, Map<Integer,Integer> columnsMap)
      从接口复制的说明: BaseBean
      Copies the passed F bean into the current bean.
      指定者:
      copy 在接口中 BaseBean
      类型参数:
      B - from bean type
      F - this bean type
      参数:
      columnsMap - columns map from F to B
      返回:
      always this bean
    • copy

      public <B extends BaseBean> B copy(Map values)
      从接口复制的说明: BaseBean
      [ENABLE_FILTER]
      Copies the passed values with key-value map into the current bean. Integer or String type required for key,otherwise ignore
      The copied columns were filtered by the beanfilter deserialization filter, and static JSON invisible columns were also filtered
      指定者:
      copy 在接口中 BaseBean
      返回:
      always this bean
    • copy

      public <B extends BaseBean> B copy(Map values, com.google.common.base.Function keyTransformer, boolean ignoreUnmap)
      从接口复制的说明: BaseBean
      [ENABLE_FILTER]
      Copies the passed values with key-value map into the current bean. Integer or String type required for key,otherwise ignore
      The copied columns were filtered by the beanfilter deserialization filter, and static JSON invisible columns were also filtered
      指定者:
      copy 在接口中 BaseBean
      参数:
      keyTransformer - function for transform key in map to column id or name,ignore if null
      ignoreUnmap - ignore the value if return null column column(id or name) by keyTransformer
      返回:
      always this bean
    • copyNoFilter

      public <B extends BaseBean> B copyNoFilter(Map values)
      从接口复制的说明: BaseBean
      [DISABLE_FILTER]
      Copies the passed values with key-value map into the current bean. Integer or String type required for key,otherwise ignore
      指定者:
      copyNoFilter 在接口中 BaseBean
      返回:
      always this bean
    • copyNoFilter

      public <B extends BaseBean> B copyNoFilter(Map values, com.google.common.base.Function keyTransformer, boolean ignoreUnmap)
      从接口复制的说明: BaseBean
      [DISABLE_FILTER]
      Copies the passed values with key-value map into the current bean. Integer or String type required for key,otherwise ignore
      指定者:
      copyNoFilter 在接口中 BaseBean
      参数:
      keyTransformer - function for transform key in map to column id or name,ignore if null
      ignoreUnmap - ignore the value if return null column column(id or name) by keyTransformer
      返回:
      always this bean
    • equalColumn

      public boolean equalColumn(Object object, int columnId)
      从接口复制的说明: BaseBean
      check column equation.
      指定者:
      equalColumn 在接口中 BaseBean
      参数:
      object - the bean to compare
      columnId - column id
      返回:
      true if special column is equal to object,otherwise false
    • equalColumn

      public boolean equalColumn(Object object, int... fieldList)
      从接口复制的说明: BaseBean
      check columns equation.
      指定者:
      equalColumn 在接口中 BaseBean
      参数:
      object - the bean to compare
      fieldList - the column id list to compare to the current bean
      返回:
      true if special columns is all equal to object,otherwise false
    • equalColumn

      public boolean equalColumn(Object object, com.google.common.base.Predicate<Integer> fieldFilter, int... fieldList)
      从接口复制的说明: BaseBean
      check columns equation.
      指定者:
      equalColumn 在接口中 BaseBean
      参数:
      object - the bean to compare
      fieldFilter - the filter for column name,ignore if null
      fieldList - the column id list to compare to the current bean
      返回:
      true if special columns is all equal to object,otherwise false
    • equalColumn

      public boolean equalColumn(Object object, com.google.common.base.Predicate<String> fieldFilter, String... fieldList)
      从接口复制的说明: BaseBean
      check columns equation.
      指定者:
      equalColumn 在接口中 BaseBean
      参数:
      object - the bean to compare
      fieldFilter - the filter for column name,ignore if null
      fieldList - the column name list to compare to the current bean
      返回:
      true if special columns is all equal to object,otherwise false
    • tableName

      public final String tableName()
      指定者:
      tableName 在接口中 BaseBean
      返回:
      table name of this bean
    • setStringLimit

      public static final void setStringLimit(int limit)
    • toString

      public String toString(boolean notNull, boolean fullIfStringOrBytes)
      指定者:
      toString 在接口中 BaseBean
      参数:
      notNull - output not null field only if true
      fullIfStringOrBytes - for string or bytes field,output full content if true,otherwise output length.
      返回:
      Returns a string representation of the object
    • equals

      public boolean equals(Object object)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • compareTo

      public int compareTo(BaseRow object)
      指定者:
      compareTo 在接口中 Comparable<BaseRow>
    • clone

      public BaseRow clone()
      指定者:
      clone 在接口中 BaseBean
      覆盖:
      clone 在类中 Object
    • fetchMetaData

      public RowMetaData fetchMetaData()
      return RowMetaData instance for current bean
      从以下版本开始:
      3.9.0
    • truncate

      public void truncate(int columnID)
      truncate String,binary field
      参数:
      columnID -
      从以下版本开始:
      3.17.7
    • truncate

      public void truncate(String column)
      truncate String,binary field
      参数:
      column - column name or field name
      从以下版本开始:
      3.17.7