@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface ElementCollection
Example: @Entity public class Person { @Id protected String ssn; protected String name; ... @ElementCollection protected Set<String> nickNames = new HashSet(); ... }
Modifier and Type | Optional Element and Description |
---|---|
FetchType |
fetch
(Optional) Whether the collection should be lazily loaded or must be
eagerly fetched.
|
java.lang.Class |
targetClass
(Optional) The basic or embeddable class that is the element
type of the collection.
|
public abstract java.lang.Class targetClass
public abstract FetchType fetch