facebook

Generate boolean field

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #214517 Reply

    Wayne Kidd
    Member

    I am using mysql and I want to have a boolean field in a table. There is not really such a field type in the database. of course. However, hibernate can manage either a char field (y/n or t/f) or a little int (0/1). My problem is that since the field looks like (in my case) a tiny int, the generation from the DBBrowser does not give me the opportunity to change how the xml or the generated classes come out. What can I do?

    Thanks
    Wayne

    #214519 Reply

    Riyad Kalla
    Member

    Wayne, I’ve asked Jeff to have a look at this as we are aware of the num -> num mapping, he did mention that enhancements in the future releases will allow customizations for this, but I’m hoping he can provide a good workaround for you temporarily.

    #214527 Reply

    snpe
    Member

    edit hbm.xml direct

    #214539 Reply

    support-jeff
    Member

    snpe is spot on. Cannot do much better. Otherwise wait for enhancements

    #214546 Reply

    Wayne Kidd
    Member

    That is fine. The thing I should let you know is that the generated base class also needs editing and that is kind of a problem since the generated comments say don’t change it. More importantly, this will cause regeneration to fail (puts back the old problems). You can see that this is an problem that keeps on giving.

    Wayne

    #214549 Reply

    snpe
    Member

    You will edit hbm.xml file with every tools – hibernate is complex and development is quick and no one tools follow this – regenerate isn’t problem, because entity tables change aren’t often
    ddl to hbm mapping is only first step

    regards

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Generate boolean field

You must be logged in to post in the forum log in