Hibernate Annotations Sample
源代码在线查看: b.java
//$ package org.hibernate.test.annotations.collectionelement.deepcollectionelements; import java.util.List; import javax.persistence.Embeddable; import javax.persistence.Transient; import javax.persistence.OneToMany; import org.hibernate.annotations.CollectionOfElements; import org.hibernate.annotations.IndexColumn; @Embeddable public class B { private String name; //@CollectionOfElements @OneToMany @IndexColumn( name = "ndx" ) private List listOfC; public List getListOfC() { return listOfC; } public void setListOfC(List listOfC) { this.listOfC = listOfC; } public String getName() { return name; } public void setName(String name) { this.name = name; } }