/** * @return the authorizedGrantTypes */ @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name="client_grant_type", joinColumns=@JoinColumn(name="owner_id") ) @Column(name="grant_type") public Set<String> getGrantTypes() { return grantTypes; }
@ElementCollection @CollectionTable(name = "Add_Inh") public Set<Inhabitant> getInhabitants() { return inhabitants; }
@ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name = "investments", joinColumns = @JoinColumn( name = "customer_id" ) ) public List<Investment> getInvestments() { return investments; } public void setInvestments(List<Investment> investments) {
@Entity(name = "Match") @Table(name = "Match", catalog = "hibernate_orm_test_collation", schema = "dbo") public static class Match { @Id long id; String match; @ElementCollection @CollectionTable(catalog = "hibernate_orm_test_collation", schema = "dbo") private Map<Integer, Integer> timeline = new TreeMap<>(); }
/** * @author Steve Ebersole */ @Entity public class Container { @Id private Integer id; @ElementCollection private List<Item> items; }
@Entity public class WealthyPerson extends Person { @ElementCollection protected Set<Address> vacationHomes = new HashSet<Address>(); @ElementCollection protected Set<Address> legacyVacationHomes = new HashSet<Address>(); @ElementCollection @CollectionTable(name = "WelPers_VacHomes", indexes = @Index( columnList = "countryName, type_id")) protected Set<Address> explicitVacationHomes = new HashSet<Address>(); }
@Entity(name = "A") @Audited public static class A extends AbstractEntity { @ElementCollection private Map<B, C> map = new HashMap<>(); public Map<B, C> getMap() { return map; } public void setMap(Map<B, C> map) { this.map = map; } }
@ElementCollection( targetClass = String.class, fetch = FetchType.EAGER ) @CollectionType( type = "DefaultableList" ) @JoinColumn( name = "ENT_ID" ) @OrderColumn( name = "POS" ) @Column(name = "VAL") public List getValues() { return values; }
@ElementCollection // HHH-7732 -- "EntityWithAnElementCollection_someStrings" is too long for Oracle. @JoinTable( name = "SomeStrings", joinColumns = @JoinColumn( name = "EWAEC_ID") ) public Set<String> getSomeStrings() { return someStrings; }
@ElementCollection( fetch = FetchType.EAGER ) @MapKeyColumn( name = "NAME" ) @Lob @Column( name = "VALUE", length = 65535 ) @Override public Map<String, String> getParameters() { return parameterMap; }
@Entity @Table(name="AnEntity") public static class AnEntity { @Id @GeneratedValue private int id; @ElementCollection @CollectionTable(name = "AnEntity_aCollection", joinColumns = { @JoinColumn( name = "AnEntity_id" ) }) private Map<String, String> aCollection = new HashMap<String, String>(); } }
/** * @return the defaultACRvalues */ @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name="client_default_acr_value", joinColumns=@JoinColumn(name="owner_id") ) @Column(name="default_acr_value") public Set<String> getDefaultACRvalues() { return defaultACRvalues; }
@Entity( name = "Movie" ) public static class Movie { @Id private Integer id; String title; @ElementCollection // @OneToMany Map<Person,String> cast; }
@ElementCollection @CollectionTable(name = "user_email_addresses2", joinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id")) public Set<EmailAddress> getEmailAddresses2() { return emailAddresses2; }
@ElementCollection @JoinColumn @JoinTable(name = "T_NICKNAMES_D") @OrderBy( "desc" ) public Set<String> getNickNamesDescendingNaturalSort() { return nickNamesDescendingNaturalSort; }
@Entity @Table(name="AnEntity") public static class AnEntity { @Id @GeneratedValue private int id; @ElementCollection @CollectionTable(name = "AnEntity_aCollection", joinColumns = { @JoinColumn( name = "AnEntity_id" ) }) private Set<String> aCollection = new HashSet<>(); } }
/** * @return the postLogoutRedirectUri */ @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name="client_post_logout_redirect_uri", joinColumns=@JoinColumn(name="owner_id") ) @Column(name="post_logout_redirect_uri") public Set<String> getPostLogoutRedirectUris() { return postLogoutRedirectUris; }
@Entity(name = "Person") public static class Person { @Id private Long id; @ElementCollection private List<Phone> phones = new ArrayList<>(); //Getters and setters are omitted for brevity //end::collections-embeddable-type-collection-lifecycle-entity-example[] public List<Phone> getPhones() { return phones; } //tag::collections-embeddable-type-collection-lifecycle-entity-example[] }
@ElementCollection @CollectionTable(name = "user_email_addresses", joinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id")) public Set<EmailAddress> getEmailAddresses() { return emailAddresses; }
@ElementCollection @JoinColumn @JoinTable(name = "T_NICKNAMES_A") @OrderBy // testing default @OrderBy mapping public Set<String> getNickNamesAscendingNaturalSort() { return nickNamesAscendingNaturalSort; }