The given SQL statement must have exactly the number of JDBC
? parameters that Hibernate expects, that is, one for each column
mapped by the entity, in the exact order Hibernate expects. In particular,
the primary key columns must come last.
If a column should not be written as part of the insert statement,
and has no corresponding JDBC parameter in the custom SQL, it must be mapped
using insertable=false.
A custom SQL insert statement might assign a value to a mapped column as it
is written. In this case, the corresponding property of the entity remains
unassigned after the insert is executed unless
@Generated is specified, forcing Hibernate to reread the
state of the entity after each insert.
Similarly, a custom insert statement might transform a mapped column value
as it is written. In this case, the state of the entity held in memory
loses synchronization with the database after the insert is executed unless
@Generated(writable=true) is specified, again forcing
Hibernate to reread the state of the entity after each insert.
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public ResultCheckStyle | |
| public String | |
| public String | Returns: the name of the secondary tableThe name of the table in the case of an entity with |
| callable | back to summary |
|---|---|
| public boolean callable() Is the statement callable (aka a | |
| check | back to summary |
|---|---|
| public ResultCheckStyle check() For persistence operation what style of determining results (success/failure) is to be used. | |
| sql | back to summary |
|---|---|
| public String sql() Procedure name or SQL | |
| table | back to summary |
|---|---|
| public String table() The name of the table in the case of an entity with
| |