Hi guys,
is there any example of creating a Master-Detail table using Tapestry-hibernate.
I've tried create two entity clas :
@Entity
public class TaskItem {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@NonVisual
private Long id;
private User user;
public Long getId() {
return id;
}
@ManyToOne(targetEntity=User.class)
@JoinColumn(name="USER_ID")
public User getUser() {
return user;
}
}
and
@Entity
public class User {
public enum AccessLevel {
User, Admin, DataEntry
}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@NonVisual
private Long id;
private String username;
private String password;
public Long getId() {
return id;
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
}
Its pretty basic stuff, but i've got an error :
org.hibernate.MappingException
Could not determine type for: com.cie2.tip.entities.User, at table:
TaskItem, for columns: [org.hibernate.mapping.Column(user)]
I think there's no problem with the .tml file. Since if i change the
user variable type into Integer, the data will be inserted to the
database.
Can anyone help ?
Cheers,
Abangkis
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]