Module org.seasar.doma.core
Package org.seasar.doma.jdbc.entity
Class AssignedIdPropertyType<ENTITY,BASIC,CONTAINER>
java.lang.Object
org.seasar.doma.jdbc.entity.DefaultPropertyType<ENTITY,BASIC,CONTAINER>
org.seasar.doma.jdbc.entity.AssignedIdPropertyType<ENTITY,BASIC,CONTAINER>
- Type Parameters:
ENTITY- the entity type containing this assigned ID propertyBASIC- the basic type of the assigned ID propertyCONTAINER- the container type of the assigned ID property
- All Implemented Interfaces:
EntityPropertyType<ENTITY,BASIC>
public class AssignedIdPropertyType<ENTITY,BASIC,CONTAINER>
extends DefaultPropertyType<ENTITY,BASIC,CONTAINER>
Represents a property in an entity class that is used as a primary key with an
application-assigned value.
An assigned ID property is annotated with Id but not with GeneratedValue, indicating that the application is responsible for assigning the
ID value before the entity is inserted into the database.
Implementations of this class are typically generated at compile time by the Doma annotation processor.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.seasar.doma.jdbc.entity.DefaultPropertyType
DefaultPropertyType.DefaultProperty -
Field Summary
Fields inherited from class org.seasar.doma.jdbc.entity.DefaultPropertyType
columnName, columnType, entityClass, field, insertable, name, namingType, prefix, quoteRequired, scalarSupplier, simpleName, updatable -
Constructor Summary
ConstructorsConstructorDescriptionAssignedIdPropertyType(Class<ENTITY> entityClass, Supplier<Scalar<BASIC, CONTAINER>> scalarSupplier, String name, String columnName, NamingType namingType, boolean quoteRequired) Constructs a new assigned ID property type. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisId()Determines whether this property represents a primary key (identifier).Methods inherited from class org.seasar.doma.jdbc.entity.DefaultPropertyType
copy, createProperty, getColumnName, getColumnName, getColumnName, getColumnName, getName, isInsertable, isQuoteRequired, isTenantId, isUpdatable, isVersion, modifyIfNecessary
-
Constructor Details
-
AssignedIdPropertyType
public AssignedIdPropertyType(Class<ENTITY> entityClass, Supplier<Scalar<BASIC, CONTAINER>> scalarSupplier, String name, String columnName, NamingType namingType, boolean quoteRequired) Constructs a new assigned ID property type.This constructor is typically called by the Doma annotation processor when generating implementations of
EntityType.- Parameters:
entityClass- the entity classscalarSupplier- the supplier of scalar that represents the property valuename- the property namecolumnName- the column namenamingType- the naming conventionquoteRequired- whether the column name requires quoting in SQL
-
-
Method Details
-
isId
public boolean isId()Determines whether this property represents a primary key (identifier).This method indicates if the property is annotated with
Id, which marks it as a primary key column in the database table.This implementation always returns
truesince this property type represents an ID property with an application-assigned value.- Specified by:
isIdin interfaceEntityPropertyType<ENTITY,BASIC> - Overrides:
isIdin classDefaultPropertyType<ENTITY,BASIC, CONTAINER> - Returns:
true- See Also:
-