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
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 Hibernate Type
, together with zero or
more columns
. In the mapping model, a Value
always comes
wrapped in something with higher-level semantics, for example, a property, a
collection, or a class.
-
Method Summary
Modifier and TypeMethodDescriptionaccept
(ValueVisitor visitor) default void
checkColumnDuplication
(Set<String> distinctColumns, String owner) Checks if this value contains any duplicate column.copy()
void
void
createUniqueKey
(MetadataBuildingContext context) default MetadataBuildingContext
boolean[]
If the mapping involves only columns, return them.int
The number of columns and formulas in the mapping.boolean[]
Same asgetColumns()
except it returns the PK for the non-owning side of a one-to-one association.default String
The mapping to columns and formulas.default JdbcMapping
getSelectableType
(Mapping factory, int index) Deprecated.default JdbcMapping
getSelectableType
(MappingContext mappingContext, int index) getTable()
getType()
default List<Selectable>
Same asgetSelectables()
except it returns the PK for the non-owning side of a one-to-one association.boolean
boolean
boolean
boolean
boolean
isColumnInsertable
(int index) boolean
isColumnUpdateable
(int index) boolean
boolean
boolean
default boolean
Deprecated.boolean
isValid
(MappingContext mappingContext) void
setTypeUsingReflection
(String className, String propertyName)
-
Method Details
-
getColumnSpan
int getColumnSpan()The number of columns and formulas in the mapping. -
getSelectables
List<Selectable> getSelectables()The mapping to columns and formulas. -
getColumns
If the mapping involves only columns, return them.- Throws:
AssertionFailure
- if the mapping involves formulas
-
getVirtualSelectables
Same asgetSelectables()
except it returns the PK for the non-owning side of a one-to-one association. -
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
- Throws:
MappingException
-
getSelectableType
@Deprecated(since="7.0") default JdbcMapping getSelectableType(Mapping factory, int index) throws MappingException Deprecated.- Throws:
MappingException
-
getSelectableType
@Incubating default JdbcMapping getSelectableType(MappingContext mappingContext, 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
-
isSimpleValue
boolean isSimpleValue() -
isValid
Deprecated.- Throws:
MappingException
-
isValid
- Throws:
MappingException
-
setTypeUsingReflection
- Throws:
MappingException
-
accept
-
isSame
-
getColumnInsertability
boolean[] getColumnInsertability() -
hasAnyInsertableColumns
boolean hasAnyInsertableColumns() -
getColumnUpdateability
boolean[] getColumnUpdateability() -
hasAnyUpdatableColumns
boolean hasAnyUpdatableColumns() -
getBuildingContext
-
getServiceRegistry
ServiceRegistry getServiceRegistry() -
copy
Value copy() -
isColumnInsertable
boolean isColumnInsertable(int index) -
isColumnUpdateable
boolean isColumnUpdateable(int index) -
getExtraCreateTableInfo
-
checkColumnDuplication
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
-
getSelectableType(MappingContext, int)