Class JKColumnWrapper

java.lang.Object
com.jk.data.dataaccess.orm.meta.JKColumnWrapper
All Implemented Interfaces:
Annotation

public class JKColumnWrapper extends Object implements jakarta.persistence.Column
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

    Constructors
    Constructor
    Description
    JKColumnWrapper(Field field, jakarta.persistence.Column original)
    This method constructs a new JKColumnWrapper with the provided parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    Class<? extends Annotation>
    Returns the annotation interface of this annotation.
    (Optional) The SQL fragment that is used when generating the DDL for the column.
    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
    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
    This method checks whether this column has an identifier (ID) or not.
    int
    boolean
    int
    int
    void
    setId(jakarta.persistence.Id id)
    This method sets the column identifier (ID).
    void
    This method sets the sort information to the provided parameter.
    Returns a string representation of the object.
    boolean
    boolean

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • JKColumnWrapper

      public JKColumnWrapper(Field field, jakarta.persistence.Column original)
      This method constructs a new JKColumnWrapper 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

      public Class<? extends Annotation> annotationType()
      Returns the annotation interface of this annotation.
      Specified by:
      annotationType in interface Annotation
      Returns:
      the annotation interface of this annotation
    • columnDefinition

      public String 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

      public String name()
    • nullable

      public boolean nullable()
    • precision

      public int precision()
    • scale

      public int scale()
    • table

      public String table()
    • unique

      public boolean unique()
    • updatable

      public boolean updatable()
    • toString

      public String toString()
      Returns a string representation of the object.
      Specified by:
      toString in interface Annotation
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.
    • getFieldName

      public String getFieldName()
      This method gets the name of the field in the entity class that correspond to this column.
      Returns:
      the field name.
    • setSortInfo

      public void setSortInfo(JKSortInfo sortInfo)
      This method sets the sort information to the provided parameter.
      Parameters:
      sortInfo - Specifies the new sort information.
    • getSortInfo

      public JKSortInfo 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

      public Field 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.