-
1. Re: what´s the error
oskar.carlstedt May 7, 2007 4:00 AM (in response to sashaxiv)Are you sure you want to use Double as you id type. Normally databases are using integers for ids. Try to use Long ,or Integer if you can gurarantee that you won't exceed the max int value, instead?
With kind regards
Oskar -
2. Re: what´s the error
sashaxiv May 7, 2007 4:28 AM (in response to sashaxiv)thanks Oscar, i tried to use Long and the error persists.....
-
3. Re: what´s the error
sashaxiv May 7, 2007 6:13 AM (in response to sashaxiv)i think this is interesting. I fixed my error but it was not in my UsuarioEJb class!! Jboss was misleading me. The error was in other class related to UsuarioEJb
i had
Column(name="idUsuario", updatable=false, insertable=false)
public UsuarioEJB getUsuario(){
return this.usuario;
}
and this is how i fixed the error
@ManyToOne
@JoinColumn(name="idUsuario", updatable=false, insertable=false)
public UsuarioEJB getUsuario(){
return this.usuario;
}
i think jboss should have other trace for the error.
Regards!! -
4. Re: what´s the error
oskar.carlstedt May 7, 2007 6:32 AM (in response to sashaxiv)Good work!
Sometimes it is hard for JBoss to find a good error message. When you specify the column annotation, JBoss tries to save/serialize the object into that column, no matter of what type it is. So in this case, JBoss finds the UsuarioEJB and then i tries to save it into the column idUsuario - and here is the place where everything goes wrong. How can Jboss serialize UsuarioEJB into the specified column, it doesn't have a type for it, ...
//Oskar