@Override @ElementCollection(fetch=FetchType.EAGER) @CollectionTable( joinColumns=@JoinColumn(name="owner_id"), name="token_scope" ) public Set<String> getScope() { return scope; }
/** * @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; }
@Entity(name = "Person") public static class Person { @Id private Long id; @Temporal(TemporalType.TIMESTAMP) @ElementCollection @CollectionTable(name = "phone_register") @Column(name = "since") private Map<Phone, Date> phoneRegister = new HashMap<>(); //Getters and setters are omitted for brevity //end::collections-map-value-type-entity-key-example[] public Person() {} public Person(Long id) { this.id = id; } public Map<Phone, Date> getPhoneRegister() { return phoneRegister; } //tag::collections-map-value-type-entity-key-example[] }
/** * @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; }
@ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name = "investments", joinColumns = @JoinColumn( name = "customer_id" ) ) public List<Investment> getInvestments() { return investments; } public void setInvestments(List<Investment> investments) {
@Column(name = LOG_APPENDER_MIN_LOG_SCHEMA_VERSION) private int minLogSchemaVersion; @Column(name = LOG_APPENDER_MAX_LOG_SCHEMA_VERSION) private int maxLogSchemaVersion; @Column(name = LOG_APPENDER_CONFIRM_DELIVERY) private boolean confirmDelivery; @ElementCollection(targetClass = LogHeaderStructureDto.class) @Enumerated(EnumType.STRING) @CollectionTable(name = "header_structure") @Column(name = "structure_field", nullable = false) private List<LogHeaderStructureDto> headerStructure;
@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<>(); }
/** * @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; }
@ElementCollection @CollectionTable(name = "user_email_addresses2", joinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id")) public Set<EmailAddress> getEmailAddresses2() { return emailAddresses2; }
@Entity @Table( name = "AGG_TYPE" ) public static class AggregatedTypeValue { @Id UUID id; @Embedded @AttributeOverrides({ @AttributeOverride(name = "type", column = @Column(name = "content_type")), @AttributeOverride(name = "value", column = @Column(name = "content_value")) }) TypeValue content; @CollectionTable( name = "ATTRIBUTES" ) @ElementCollection(fetch = FetchType.EAGER) @MapKeyColumn(name = "attribute_name") @AttributeOverrides({ @AttributeOverride(name = "value.type", column = @Column(name = "attribute_type")), @AttributeOverride(name = "value.value", column = @Column(name = "attribute_value")) }) Map<String, TypeValue> attributes; } }
@Entity(name = "Match") @Table(name = "MATCH") public static class Match { @Id private Long id; @ElementCollection(fetch = FetchType.EAGER) @CollectionTable private Map<Integer, Integer> timeline = new TreeMap<>(); }
/** * @return the scope */ @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name="authentication_holder_scope", joinColumns=@JoinColumn(name="owner_id") ) @Column(name="scope") public Set<String> getScope() { return scope; }
@ElementCollection @CollectionTable(name = "user_email_addresses", joinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id")) public Set<EmailAddress> getEmailAddresses() { return emailAddresses; }
@AttributeOverride(name = "key.street", column = @Column(name = "STREET_NAME")), @AttributeOverride(name = "value.size", column = @Column(name = "SQUARE_FEET")), @AttributeOverride(name = "value.tax", column = @Column(name = "ASSESSMENT")) }) @ElementCollection public Map<Address, PropertyInfo> parcels; @AttributeOverride(name = "value.tax", column = @Column(name = "ASSESSMENT")) }) @ElementCollection @CollectionTable(name="LegacyParcels") public Map<Address, PropertyInfo> legacyParcels; @AttributeOverride(name = "tax", column = @Column(name = "ASSESSMENT")) }) @ElementCollection public Set<PropertyInfo> unsortedParcels;
@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>(); }
/** * @return the requestUris */ @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name="client_request_uri", joinColumns=@JoinColumn(name="owner_id") ) @Column(name="request_uri") public Set<String> getRequestUris() { return requestUris; }
@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>(); } }
private long since; @AttributeOverrides({ @AttributeOverride(name = "name", column = @Column(name = "dealer_name", table = "T_DEALER")), @AttributeOverride(name = "rate", column = @Column(table = "T_DEALER")) }) @Embedded private Dealer dealer; @ElementCollection @CollectionTable(name = "CAR_DEALTERS", indexes = @Index(columnList = "name")) private Set<Dealer> otherDealers;
@ElementCollection @CollectionTable(name = "ExchangeO_exchangeRateFees") private Map<ExchangeRateKey, BigDecimal> exchangeRateFees = new java.util.HashMap<ExchangeRateKey, BigDecimal>();