-->
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.  [ 2 posts ] 
Author Message
 Post subject: How do I get collections inside @Embeddable classes to work?
PostPosted: Fri Oct 05, 2007 11:00 am 
Newbie

Joined: Wed Oct 03, 2007 12:28 pm
Posts: 15
According to this:

http://www.hibernate.org/329.html?cmd=c ... tnode=2718

"Hibernate Annotations currently does not support associations inside embeddable objects."

So I can't mark Collections as @CollectionOfElements. If I do, I get a "ConcurrentModificationException" much like the poster here:

http://forum.hibernate.org/viewtopic.ph ... nexception

So how do I get this to work?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 05, 2007 11:30 am 
Newbie

Joined: Wed Oct 03, 2007 12:28 pm
Posts: 15
Here's some sample code. Note that if @CollectionOfElements annotation is there, I get :

WARNING: com.sun.enterprise.deployment.backend.IASDeploymentException: java.util.ConcurrentModificationException

If I delete the annotation, then I get the following:

org.hibernate.MappingException: Could not determine type for: java.util.List, for columns: [org.hibernate.mapping.Column(partNumber)]

Code:
@Embeddable
public class SystemBoardType
    implements Equals, HashCode, ToString {

  @XmlTransient
  protected List<String> partNumber;

  @CollectionOfElements
    public List<String> getPartNumber() {
        if (partNumber== null) {
            partNumber = new ArrayList<String>();
        }
        return this.partNumber;
    }

    public void setPartNumberList<String> partNumber {
        this.partNumber = partNumber;
    }

    @Transient
    public boolean isSetPartNumber() {
        return ((this.partNumber!= null)&&(!this.partNumber.isEmpty()));
    }

    public void unsetPartNumber() {
        this.partNumber = null;
    }


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

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.