-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Assertion Fails with @ElementCollection
PostPosted: Wed Dec 08, 2010 2:56 pm 
Newbie

Joined: Mon Feb 23, 2009 11:16 am
Posts: 17
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.