[jboss-jira] [JBoss JIRA] Commented: (EJBTHREE-1188) Deployment of @ManyToMany fails.
Alexander Tsirel (JIRA)
jira-events at lists.jboss.org
Mon Feb 4 12:06:04 EST 2008
[ http://jira.jboss.com/jira/browse/EJBTHREE-1188?page=comments#action_12398085 ]
Alexander Tsirel commented on EJBTHREE-1188:
--------------------------------------------
What do you mean by test case?
If I'll attach zip file with my sources - will it be enough?
Actually this two files with entities are enough.
persistence.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="first">
<jta-data-source>java:/TestEJB3DS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
</properties>
</persistence-unit>
</persistence>
> Deployment of @ManyToMany fails.
> --------------------------------
>
> Key: EJBTHREE-1188
> URL: http://jira.jboss.com/jira/browse/EJBTHREE-1188
> Project: EJB 3.0
> Issue Type: Bug
> Components: EJB3 Extensions
> Affects Versions: AS 4.2.1.GA
> Environment: JBoss Bootstrap Environment
> JBOSS_HOME: C:\jboss-4.2.1.GA
> JAVA: C:\Program Files\Java\jdk1.5.0_09\bin\java
> JAVA_OPTS: -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
> CLASSPATH: C:\Program Files\Java\jdk1.5.0_09\lib\tools.jar;C:\jboss-4.2.1.GA\bin\run.jar
> Reporter: Alexander Tsirel
>
> Two entities relates as many to many (Course and Student).
> During deployment it throws:
> Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Collection, for columns: org.hibernate.mapping.Column(students)]
> Both sides using Generics.
> Here is the latest code:
> @Entity(name = "StudentUni")
> public class Student implements Serializable {
> private int id;
> private String name;
> private Collection<Course> courses = new ArrayList<Course>();
> public Student(){
> id = (int) System.nanoTime();
> }
> @Id
> public int getId() {
> return id;
> }
> public void setId(int id) {
> this.id = id;
> }
> public String getName() {
> return name;
> }
> public void setName(String name) {
> this.name = name;
> }
> @ManyToMany
> public Collection<Course> getCourses() {
> return courses;
> }
> public void setCourses(Collection<Course> courses) {
> this.courses = courses;
> }
> }
> @Entity(name = "CourseUni")
> public class Course implements Serializable {
> private int id;
> private String courseName;
> private Collection<Student> students = new ArrayList<Student>();
> public Course(){
> id = (int) System.nanoTime();
> }
> @Id
> public int getId() {
> return id;
> }
> public void setId(int id) {
> this.id = id;
> }
> public String getCourseName() {
> return courseName;
> }
> public void setCourseName(String courseName) {
> this.courseName = courseName;
> }
> @ManyToMany(mappedBy = "courses")
> public Collection<Student> getStudents() {
> return students;
> }
> public void setStudents(Collection<Student> students) {
> this.students = students;
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list