-
1. Catalog "xxx" cannot be resolved for table
samwun9988 Feb 7, 2011 8:39 AM (in response to samwun9988)Hello,
Here is another Hibernate generated class: It also highed:
1. the Catalog = "houseware" has an error message "Catalog "houseware" cannot be resolved for table "role""
2: "Class Role" has an error message "The serializable class Role does not declare a static final serialVersionUID field of type long".
If I added " private static final long serialVersionUID = 1L;" to the Class, the second error is gone.
If I remove "catalog = "houseware"" , the first error is gone.
But why can't I have catalog for the Class?
Here is the generated source code:
package au.com.houseware.persistence;
// Generated 08/02/2011 12:30:34 AM by Hibernate Tools 3.4.0.CR1
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
* Role generated by hbm2java
*/
@Entity
@Table(name = "role", catalog = "houseware")
public class Role implements java.io.Serializable {
private int roleId;
private String roleName;
private Set<User> users = new HashSet<User>(0);
public Role() {
}
public Role(int roleId) {
this.roleId = roleId;
}
public Role(int roleId, String roleName, Set<User> users) {
this.roleId = roleId;
this.roleName = roleName;
this.users = users;
}
@Id
@Column(name = "role_id", unique = true, nullable = false)
public int getRoleId() {
return this.roleId;
}
public void setRoleId(int roleId) {
this.roleId = roleId;
}
@Column(name = "role_name", length = 20)
public String getRoleName() {
return this.roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "role")
public Set<User> getUsers() {
return this.users;
}
public void setUsers(Set<User> users) {
this.users = users;
}
}
Thanks
Sam
-
2. Catalog "xxx" cannot be resolved for table
nickarls Feb 7, 2011 8:42 AM (in response to samwun9988)You're running against a DB that supports the catalog concept?
-
3. Catalog "xxx" cannot be resolved for table
samwun9988 Feb 7, 2011 9:05 AM (in response to nickarls)Oh.. no.
So I can remove that?
Thanks
Sam
-
4. Catalog "xxx" cannot be resolved for table
nickarls Feb 8, 2011 3:47 AM (in response to samwun9988)Should be optional yes (and you spent more time asking the question than it would have taken to test it) ;-)