Package io.github.mfvanek.pg.model.table
Class ColumnWithSerialType
java.lang.Object
io.github.mfvanek.pg.model.table.ColumnWithSerialType
- All Implemented Interfaces:
ColumnNameAware
,TableNameAware
,Comparable<ColumnWithSerialType>
@Immutable
public class ColumnWithSerialType
extends Object
implements ColumnNameAware, Comparable<ColumnWithSerialType>
A representation of column with serial type in database table.
- Since:
- 0.6.2
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(ColumnWithSerialType other) final boolean
Gets column name in the table.Gets name of the associated sequence.Gets raw type of serial column.Gets table name.final int
hashCode()
boolean
Shows whether column can or cannot accept null values.static ColumnWithSerialType
of
(Column column, SerialType serialType, String sequenceName) static ColumnWithSerialType
ofBigSerial
(Column column, String sequenceName) static ColumnWithSerialType
static ColumnWithSerialType
ofSmallSerial
(Column column, String sequenceName) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.mfvanek.pg.model.table.ColumnNameAware
isNullable
-
Method Details
-
getTableName
Gets table name.- Specified by:
getTableName
in interfaceTableNameAware
- Returns:
- table name
-
getColumnName
Gets column name in the table.- Specified by:
getColumnName
in interfaceColumnNameAware
- Returns:
- column name
-
isNotNull
public boolean isNotNull()Shows whether column can or cannot accept null values.- Specified by:
isNotNull
in interfaceColumnNameAware
- Returns:
- true if column cannot accept null values
-
getSerialType
Gets raw type of serial column.- Returns:
- type of serial column
-
getSequenceName
Gets name of the associated sequence.- Returns:
- name of the associated sequence
-
toString
-
equals
-
hashCode
public final int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<ColumnWithSerialType>
-
of
@Nonnull public static ColumnWithSerialType of(@Nonnull Column column, @Nonnull SerialType serialType, @Nonnull String sequenceName) -
ofBigSerial
@Nonnull public static ColumnWithSerialType ofBigSerial(@Nonnull Column column, @Nonnull String sequenceName) -
ofSerial
@Nonnull public static ColumnWithSerialType ofSerial(@Nonnull Column column, @Nonnull String sequenceName) -
ofSmallSerial
@Nonnull public static ColumnWithSerialType ofSmallSerial(@Nonnull Column column, @Nonnull String sequenceName)
-