Class FieldInfo

java.lang.Object
onl.ycode.stormify.FieldInfo

public class FieldInfo extends Object
Information about a field in a class.
  • Method Details

    • getType

      public Class<?> getType()
      Get the type of the field.
      Returns:
      The type of the field.
    • getValue

      public Object getValue(Object item)
      Get the value of the field in a given object.
      Parameters:
      item - The object to read the field from.
      Returns:
      The value of the field.
    • setValue

      public void setValue(Object item, Object value)
      Set the value of the field in a given object.
      Parameters:
      item - The object to set the field in.
      value - The value to set.
    • getDbName

      public String getDbName()
      Get the name of the field, as used for the database queries.
      Returns:
      The database name of the field.
    • getName

      public String getName()
      Get the name of the field in the class. This name is used to perform queries based on field name. static
      Returns:
      The name of the field in the class.
    • isPrimaryKey

      public boolean isPrimaryKey()
      Check if the field is a primary key.
      Returns:
      true if the field is a primary key, false otherwise.
    • isReference

      public boolean isReference()
      Check if the field is a reference to another table.
      Returns:
      true if the field is a reference, false otherwise.
    • getSequence

      public String getSequence()
      Get the name of the sequence used for the primary key.
      Returns:
      The name of the sequence used for the primary key, or null if no sequence is found.
    • isInsertable

      public boolean isInsertable()
      Check if the field is used when creating a new database entry.
      Returns:
      true if the field is creatable, false otherwise.
    • isUpdatable

      public boolean isUpdatable()
      Check if the field is used when updating a database entry.
      Returns:
      true if the field is updatable, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object