Package com.jk.data.dataaccess.orm.meta
Class JKColumnWrapper
java.lang.Object
com.jk.data.dataaccess.orm.meta.JKColumnWrapper
- All Implemented Interfaces:
Annotation
This class is used to wrap and enhance metadata about a column in an entity
class.
It provides a way to access and manipulate attributes of a column such as its name, type, and sort information.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
ConstructorsConstructorDescriptionJKColumnWrapper
(Field field, jakarta.persistence.Column original) This method constructs a newJKColumnWrapper
with the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Annotation>
Returns the annotation interface of this annotation.(Optional) The SQL fragment that is used when generating the DDL for the column.getField()
This method gets the field in the entity class that correspond to this column.This method gets the name of the field in the entity class that correspond to this column.jakarta.persistence.Id
getId()
This method gets the column identifier (ID).jakarta.persistence.Column
This method gets the original column annotation.This method gets the sort information.boolean
Whether the column is included in SQL INSERTstatements generated by the persistence provider.boolean
isId()
This method checks whether this column has an identifier (ID) or not.int
length()
name()
boolean
nullable()
int
int
scale()
void
setId
(jakarta.persistence.Id id) This method sets the column identifier (ID).void
setSortInfo
(JKSortInfo sortInfo) This method sets the sort information to the provided parameter.table()
toString()
Returns a string representation of the object.boolean
unique()
boolean
-
Constructor Details
-
JKColumnWrapper
This method constructs a newJKColumnWrapper
with the provided parameters.- Parameters:
field
- Specifies the field in the entity class that corresponds to this column.original
- Specifies the original column annotation for this column.
-
-
Method Details
-
annotationType
Returns the annotation interface of this annotation.- Specified by:
annotationType
in interfaceAnnotation
- Returns:
- the annotation interface of this annotation
-
columnDefinition
(Optional) The SQL fragment that is used when generating the DDL for the column.Defaults to the generated SQL to create a column of the inferred type.
-
insertable
public boolean insertable()Whether the column is included in SQL INSERTstatements generated by the persistence provider. -
length
public int length() -
name
-
nullable
public boolean nullable() -
precision
public int precision() -
scale
public int scale() -
table
-
unique
public boolean unique() -
updatable
public boolean updatable() -
toString
Returns a string representation of the object.- Specified by:
toString
in interfaceAnnotation
- Overrides:
toString
in classObject
- Returns:
- a string representation of the object.
-
getFieldName
This method gets the name of the field in the entity class that correspond to this column.- Returns:
- the field name.
-
setSortInfo
This method sets the sort information to the provided parameter.- Parameters:
sortInfo
- Specifies the new sort information.
-
getSortInfo
This method gets the sort information.- Returns:
- the sort information.
-
setId
public void setId(jakarta.persistence.Id id) This method sets the column identifier (ID).- Parameters:
id
- Specifies the new column identifier (ID).
-
getOriginal
public jakarta.persistence.Column getOriginal()This method gets the original column annotation.- Returns:
- the original column annotation.
-
getField
This method gets the field in the entity class that correspond to this column.- Returns:
- the field in the entity class that correspond to this column.
-
getId
public jakarta.persistence.Id getId()This method gets the column identifier (ID).- Returns:
- the column identifier (ID).
-
isId
public boolean isId()This method checks whether this column has an identifier (ID) or not.- Returns:
- true, if it has an identifier (ID), false otherwise.
-