[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: setParameter() IllegalArgumentException

NSchweig do-not-reply at jboss.com
Sat Dec 6 07:18:44 EST 2008


Hi,

I tried to understand your hints but it is difficult as beginner in ejb. This is all I can say:

failure of a security check
I think with security it has nothing to do because the only thing I do with security is authentification with UserRolesLoginModule in the webapplication.

an exception occurring inside the getter or setter method 
Which getter or setter is meant here?

a nullable database column was mapped to a primitive-type property 
The table "course" in my db has an id(Long in Java) (in db bigint) 
The "instructor" is mapped here with his foreign key(Long id in Java, in db bigint) The field "instructor" is nullable.
The instructor is from tpye "CmtUser". 


  | @Entity
  | public class Course implements Serializable{
  | 	@Id
  | 	@GeneratedValue(strategy = GenerationType.AUTO)
  | 	private Long id;
  | 	
  | 	private String title;
  | 	private String abbreviation;
  | 	private String description;
  | 	private String semester;
  | 	@Column(columnDefinition="BOOL") 
  | 	private boolean active = false;
  | 
  | 	@ManyToOne
  | 	@JoinColumn(name="instructor")
  | 	private CmtUser instructor;
  | 	
  | 	public Course(){}
  | 	
  | 	public Course(String title, String abbreviation, String description, String semester,boolean active,CmtUser instructor){
  | 		this.title = title;
  | 		this.abbreviation = abbreviation;
  | 		this.description = description;
  | 		this.semester = semester;
  | 		this.active = active;
  | 		this.instructor = instructor;
  | 	}
  | ...getter and setter

@Entity
  | @Table(name="CmtUser", uniqueConstraints=@UniqueConstraint(columnNames={"userName","passWord","email"}))
  | public class CmtUser implements Serializable{
  | 	
  | 	@Id
  | 	@GeneratedValue(strategy = GenerationType.AUTO)
  | 	private Long id;
  | 	
  | 	private String userName;
  | 	private String firstName;
  | 	private String lastName;
  | 	private String passWord;
  | 	private String email;
  | 	
  | 	@Embedded
  | 	private UserSettings settings = new UserSettings();
  | 	
  | 	@ManyToMany(fetch=FetchType.EAGER) 
  | 	private List <Role> roles = new ArrayList<Role>();
  | 	
  | 	public CmtUser(){}
  | 	
  | 	public CmtUser(String userName, String firstName, String lastName, String passWord, String email){
  | 		this.userName = userName;
  | 		this.firstName = firstName;
  | 		this.lastName = lastName;
  | 		this.passWord = passWord;
  | 		this.email = email;
  | 	}
  | ...getter and setter

the Hibernate type was not castable to the property type (or vice-versa) 
..mmmh? I do not really understand:-(

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4194795#4194795

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4194795



More information about the jboss-user mailing list