I am attempting to create Spring MVC CRUD scaffolding from the following beans:
public class Product{
private String id;
public String getId() { return id;}
public String setId(String id) { this.id = id;}
}
public class Customer{
private String id;
private Set<Product> products;
public String getId() { return id;}
public Set<Product> getProducts{ return products;}
public void setId(String id) { this.id = id;}
public void setProducts(Set<Product> products) { this.products= products;}
}
I am deploying into the builtin Tomcat server and using the builtin Derby database. I have successfully built and run similar MVC CRUD generations with stand alone classes and with a single associative class (not a collection). I am using java.util.set due to a tip from a fellow MyEclipse for Spring developer.
This generates code with no errors, but does not deploy due to:
Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: Tank, for columns: [org.hibernate.mapping.Column(product)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:269)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
at org.hibernate.mapping.Property.isValid(Property.java:185)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1121)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1306)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
… 44 more
There are more exceptions that this one, but it seems to be the main offender. I will post the complete list if you like.
Are there Java Collection Classes that do work that I can use instead of the interface Set?
Carl