Package onl.ycode.stormify
Class FieldInfo
java.lang.Object
onl.ycode.stormify.FieldInfo
Information about a field in a class.
-
Method Summary
Modifier and TypeMethodDescriptionGet the name of the field, as used for the database queries.getName()
Get the name of the field in the class.Get the name of the sequence used for the primary key.Class<?>
getType()
Get the type of the field.Get the value of the field in a given object.boolean
Check if the field is used when creating a new database entry.boolean
Check if the field is a primary key.boolean
Check if the field is a reference to another table.boolean
Check if the field is used when updating a database entry.void
Set the value of the field in a given object.toString()
-
Method Details
-
getType
Get the type of the field.- Returns:
- The type of the field.
-
getValue
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
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
Get the name of the field, as used for the database queries.- Returns:
- The database name of the field.
-
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
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
-