File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
hibernate-core/src/main/java/org/hibernate/annotations Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 2222 * the defaulted value of a database column.
2323 * </ul>
2424 * <p>
25+ * For example, this field will be populated with the value {@code "new"} by
26+ * the database when the entity is inserted:
27+ * <pre>
28+ * @Generated @ColumnDefault(value = "'new'")
29+ * private String status;
30+ * </pre>
31+ * <p>
2532 * If {@code @Generated} is not used, a {@code default} value can cause state
2633 * held in memory to lose synchronization with the database.
2734 *
2835 * @author Steve Ebersole
2936 *
37+ * @see Generated
3038 * @see GeneratedColumn
3139 * @see DialectOverride.ColumnDefault
3240 */
Original file line number Diff line number Diff line change 4545 * a formula may involve columns of the primary table, or columns of any one of the
4646 * secondary tables. But it may not involve columns of more than one table.
4747 * <p>
48- * The {@link ColumnTransformer} annotation is an alternative in certain cases, allowing
49- * the use of native SQL to read <em>and write</em> values to a column.
48+ * The {@link ColumnTransformer @ColumnTransformer} annotation is an alternative in
49+ * certain cases, allowing the use of native SQL to read <em>and write</em> values to
50+ * a column.
5051 * <pre>
5152 * // it might be better to use @ColumnTransformer in this case
5253 * @Formula("decrypt(credit_card_num)")
5354 * String getCreditCardNumber() { ... }
5455 * </pre>
5556 *
57+ * @see Generated
5658 * @see ColumnTransformer
5759 * @see DiscriminatorFormula
5860 * @see JoinFormula
Original file line number Diff line number Diff line change 4242 * <ul>
4343 * <li>a database table has a column value populated by a database trigger,
4444 * <li>a mapped column has a default value defined in DDL, in which case
45- * {@code @Generated} is used in conjunction with {@link ColumnDefault},
45+ * {@code @Generated} is used in conjunction with the
46+ * {@link ColumnDefault @ColumnDefault} annotation,
4647 * <li>a {@linkplain #sql() SQL expression} is used to compute the value of
4748 * a mapped column,
4849 * <li>a custom SQL {@link SQLInsert insert} or {@link SQLUpdate update}
4950 * statement specified by an entity assigns a value to the annotated
5051 * property of the entity, or {@linkplain #writable transforms} the
5152 * value currently assigned to the annotated property, or
5253 * <li>there is no mapped column, and the value of the field is determined
53- * by evaluating a SQL {@link Formula}.
54+ * by evaluating a SQL {@link Formula @Formula }.
5455 * </ul>
5556 * <p>
5657 * On the other hand:
You can’t perform that action at this time.
0 commit comments