• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mapping tinyint

 
Victor Rodr�guez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to mapping an int member of a POJO with a tinyint column in MySQL and I allways have the same runtime error:

Wrong column type: estado_id, expected: integer


What is the type I must to put in the mapping file?

thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An integer. What are you using?
 
Victor Rodr�guez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using an integer.
 
Victor Rodr�guez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the atribute declaration:



and this is de mapping I have done:



I hope it is helpful,

thanks again,
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm. Have you tried a short?
 
Victor Rodr�guez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With a short the error message is:

Wrong column type: estado_id, expected: smallint
 
Victor Rodr�guez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, there was a problem with the hibernate.cfg.xml configuration file.

I was validating the Database scheme:



Without this line it works.

Thanks, very.
 
David Brossard
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you not ommit the type anyway as it is a very simple one, hibernate should auto-determine the appropriate type ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic