We have a DB with a User table that has a column of type Tinyint (Since it is a boolean) and we are working with Hibernate. My User model has a variable, autogenerated, Byte type to designate that user value (setters & getters).
The fact is that within this method:
public boolean CreateJudge(int idusuario){
boolean newJ = false;
try{
newJ = true;
this.session = Hibernate.getSessionFactory().getCurrentSession();
Usuario newJudge = new Usuario(master.setJuez((byte) 1), idusuario);
session.save(newJudge);
session.close();
}catch (Exception e){
e.printStackTrace();
}
return newJ;
}
What I want is to be able to give that value 1 to the byte and thus force that user to be a judge.
Any ideas? The proposed code does not work and I've already tried:
Usuario newJudge = new Usuario(master.setJuez(1), idusuario);