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 property
BASIC - the basic type of the assigned ID property
CONTAINER - 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:
  • 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 class
      scalarSupplier - the supplier of scalar that represents the property value
      name - the property name
      columnName - the column name
      namingType - the naming convention
      quoteRequired - 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 true since this property type represents an ID property with an application-assigned value.

      Specified by:
      isId in interface EntityPropertyType<ENTITY,BASIC>
      Overrides:
      isId in class DefaultPropertyType<ENTITY,BASIC,CONTAINER>
      Returns:
      true
      See Also: