Hi, I have the following two classes mapped:
Code:
@Entity
public class BookTick implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1572208399175067875L;
@Id
@ManyToOne
private Tradable tradable;
@Id
private long timestamp;
@ElementCollection
@CollectionTable(name = "BidQuotes", joinColumns = {
@JoinColumn(name = "tradable", referencedColumnName = "tradable_id"),
@JoinColumn(name = "timestamp", referencedColumnName = "timestamp") })
@OrderColumn(name = "level")
@Column(name = "bidQuotes")
private List<Quote> bidQuotes;
@ElementCollection
@CollectionTable(name = "AskQuotes", joinColumns = {
@JoinColumn(name = "tradable", referencedColumnName = "tradable_id"),
@JoinColumn(name = "timestamp", referencedColumnName = "timestamp") })
@OrderColumn(name = "level")
@Column(name = "askQuotes")
private List<Quote> askQuotes;
// So that hibernate may instantiate us
protected BookTick() {
}
}
and this is a Quote
Code:
@Embeddable
public class Quote implements Serializable {
/**
*
*/
private static final long serialVersionUID = -1354843737714041018L;
@Column(name = "quotePrice", precision = 10, scale = 2)
BigDecimal price = BigDecimal.ZERO;
@Column(name = "quoteSize")
int size = 0;
public Quote() {
}
}
When I attempt to initiate my app I get the following:
Caused by: org.hibernate.annotations.common.AssertionFailure: Unable to guess collection property accessor name
at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:1340)
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:693)
at org.hibernate.cfg.annotations.ListBinder$1.secondPass(ListBinder.java:95)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:65)
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1686)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1393)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1345)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
I'm using Hibernate Core 3.6.0-Final and Hibernate Annotations 3.5.6-Final. Ideas?