Hi all,
Basically as soon as I tried to flush an object (Parent with or without childs) in a one-to-many association Ive Got the following:
21:41:55,392 DEBUG SessionImpl:2321 - Flushing entities and processing referenced collections
java.lang.ClassCastException: java.util.ArrayList
at net.sf.hibernate.type.SetType.wrap(SetType.java:27)
at net.sf.hibernate.impl.WrapVisitor.processArrayOrNewCollection(WrapVisitor.java:73)
at net.sf.hibernate.impl.WrapVisitor.processCollection(WrapVisitor.java:48)
at net.sf.hibernate.impl.AbstractVisitor.processValue(AbstractVisitor.java:69)
at net.sf.hibernate.impl.WrapVisitor.processValues(WrapVisitor.java:86)
at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2374)
at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2340)
at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2207)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2186)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at mapping2.Main.main(Main.java:61)
21:41:55,422 DEBUG SessionImpl:546 - closing session
Parent use a collection such as :
private Collection offices = new ArrayList();
With following getter and setter:
/**
* Getter offices
*/
public Collection getOffices() {
return this.offices;
}
/**
* Setter
* @param offices
*/
public void setOffices(Collection office) {
this.offices = office;
}
If some one as an idea, this will help me a lot.
Thx in advance.
|