Package org.hibernate.mapping
Interface Value
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
KeyValue
- All Known Implementing Classes:
Any
,Any.KeyValue
,Any.MetaValue
,Array
,Bag
,BasicValue
,Collection
,Component
,DependantBasicValue
,DependantValue
,ExportableColumn.ValueImpl
,IdentifierBag
,IdentifierCollection
,IndexedCollection
,List
,ManyToOne
,Map
,OneToMany
,OneToOne
,PrimitiveArray
,Set
,SimpleValue
,ToOne
public interface Value extends Serializable
A mapping model object which represents something that's persisted "by value", instead of "by reference", that is, anything with no primary key.A
Value
is essentially a HibernateType
, together with zero or morecolumns
. In the mapping model, aValue
always comes wrapped in something with higher-level semantics, for example, a property, a collection, or a class.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Object
accept(ValueVisitor visitor)
default void
checkColumnDuplication(Set<String> distinctColumns, String owner)
Checks if this value contains any duplicate column.Value
copy()
void
createForeignKey()
void
createUniqueKey(MetadataBuildingContext context)
default MetadataBuildingContext
getBuildingContext()
boolean[]
getColumnInsertability()
List<Column>
getColumns()
If the mapping involves only columns, return them.int
getColumnSpan()
The number of columns and formulas in the mapping.boolean[]
getColumnUpdateability()
default List<Column>
getConstraintColumns()
Same asgetColumns()
except it returns the PK for the non-owning side of a one-to-one association.default String
getExtraCreateTableInfo()
FetchMode
getFetchMode()
List<Selectable>
getSelectables()
The mapping to columns and formulas.default JdbcMapping
getSelectableType(Mapping factory, int index)
ServiceRegistry
getServiceRegistry()
Table
getTable()
Type
getType()
default List<Selectable>
getVirtualSelectables()
Same asgetSelectables()
except it returns the PK for the non-owning side of a one-to-one association.boolean
hasAnyInsertableColumns()
boolean
hasAnyUpdatableColumns()
boolean
hasFormula()
boolean
isAlternateUniqueKey()
boolean
isColumnInsertable(int index)
boolean
isColumnUpdateable(int index)
boolean
isNullable()
boolean
isSame(Value other)
boolean
isSimpleValue()
boolean
isValid(Mapping mapping)
void
setTypeUsingReflection(String className, String propertyName)
-
-
-
Method Detail
-
getColumnSpan
int getColumnSpan()
The number of columns and formulas in the mapping.
-
getSelectables
List<Selectable> getSelectables()
The mapping to columns and formulas.
-
getColumns
List<Column> getColumns()
If the mapping involves only columns, return them.- Throws:
AssertionFailure
- if the mapping involves formulas
-
getVirtualSelectables
default List<Selectable> getVirtualSelectables()
Same asgetSelectables()
except it returns the PK for the non-owning side of a one-to-one association.
-
getConstraintColumns
default List<Column> getConstraintColumns()
Same asgetColumns()
except it returns the PK for the non-owning side of a one-to-one association.- Throws:
AssertionFailure
- if the mapping involves formulas
-
getType
Type getType() throws MappingException
- Throws:
MappingException
-
getSelectableType
@Incubating default JdbcMapping getSelectableType(Mapping factory, int index) throws MappingException
- Throws:
MappingException
-
getFetchMode
FetchMode getFetchMode()
-
getTable
Table getTable()
-
hasFormula
boolean hasFormula()
-
isAlternateUniqueKey
boolean isAlternateUniqueKey()
-
isNullable
boolean isNullable()
-
createForeignKey
void createForeignKey()
-
createUniqueKey
void createUniqueKey(MetadataBuildingContext context)
-
isSimpleValue
boolean isSimpleValue()
-
isValid
boolean isValid(Mapping mapping) throws MappingException
- Throws:
MappingException
-
setTypeUsingReflection
void setTypeUsingReflection(String className, String propertyName) throws MappingException
- Throws:
MappingException
-
accept
Object accept(ValueVisitor visitor)
-
isSame
boolean isSame(Value other)
-
getColumnInsertability
boolean[] getColumnInsertability()
-
hasAnyInsertableColumns
boolean hasAnyInsertableColumns()
-
getColumnUpdateability
boolean[] getColumnUpdateability()
-
hasAnyUpdatableColumns
boolean hasAnyUpdatableColumns()
-
getBuildingContext
@Incubating default MetadataBuildingContext getBuildingContext()
-
getServiceRegistry
ServiceRegistry getServiceRegistry()
-
copy
Value copy()
-
isColumnInsertable
boolean isColumnInsertable(int index)
-
isColumnUpdateable
boolean isColumnUpdateable(int index)
-
getExtraCreateTableInfo
@Incubating default String getExtraCreateTableInfo()
-
checkColumnDuplication
@Internal default void checkColumnDuplication(Set<String> distinctColumns, String owner)
Checks if this value contains any duplicate column. A column is considered duplicate when itsname
is already contained in thedistinctColumn
set.If a duplicate column is found, a
MappingException
is thrown.- Parameters:
distinctColumns
- set containing the names of the columns to checkowner
- the owner of this value, used just for error reporting
-
-