From 8c1f9c4aad6f00b8ab310678c7165ad7a6dd22b0 Mon Sep 17 00:00:00 2001 From: Gavin Date: Sun, 7 May 2023 10:42:08 +0200 Subject: [PATCH] fix javadoc examples for @Array and @Struct --- .../main/java/org/hibernate/annotations/Array.java | 11 +++++++++-- .../main/java/org/hibernate/annotations/Struct.java | 7 ++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/Array.java b/hibernate-core/src/main/java/org/hibernate/annotations/Array.java index 10d2c8cc8a..365fc6b2a4 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/Array.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/Array.java @@ -17,14 +17,21 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * Specifies the maximum length of a SQL array type mapped by - * the annotated attribute. For example: + * the annotated attribute. + *

+ * For example: *

- *
+ * {@code @Array(length=100)} // the maximum length of the SQL array
+ * {@code @Column(length=64)} // the maximum length of the strings in the array
+ * String[] strings;
  * 
*/ @Incubating @Target({FIELD, METHOD}) @Retention( RUNTIME ) public @interface Array { + /** + * The maximum length of the array. + */ int length(); } diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/Struct.java b/hibernate-core/src/main/java/org/hibernate/annotations/Struct.java index c9c67e1f11..d4f45cbc66 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/Struct.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/Struct.java @@ -23,14 +23,15 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; * This annotation may be applied to an embeddable class: *
  * {@code @Embeddable}
- * {@code Struct(name = "CUST")}
+ * {@code @Struct(name = "CUST")}
  * public class Customer { ... }
  * 
+ *

* Alternatively, it may be applied to an embedded attribute: *

  * public class Order {
- *     {@code Embedded}
- *     {@code Struct(name = "CUST")}
+ *     {@code @Embedded}
+ *     {@code @Struct(name = "CUST")}
  *     private Customer customer;
  * }
  *