facebook

Hibernate generate POJO and Boolean methods

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #257797 Reply

    I’m trying to use MyEclipse->Generate POJOs to generate java class files from a hibernate mapping.

    All is going well, aside from one issue when generating boolean getters. Here’s an example.
    We have a collumn EXPIRED_FL which contains either null if the person is alive, or Y if a person has passed away. I’ve mapped this property to the person class in this way:

    <property name="isExpired" formula="nvl(EXPIRED_FL,'N')" type="yes_no" not-null="true">

    This works when I use a manually created class with a method

    public boolean isExpired()

    .
    However, what MyEclipse generates is the following method:

    public Boolean getIsExpired()

    Now, I can almost live with the Boolean instead of boolean, but what I can’t abide is the “getIs”.

    How can I get MyEclipse to generate a method which starts with “is”?

    #257864 Reply

    Riyad Kalla
    Member

    This is actually an outstanding bug that I’ve added your comments to, sorry for the trouble with the weird naming.

    #257917 Reply

    Are you using the same code base as the Hibernate Tools? I.e. if I grab the source for the hibernate tools and fix it there, would it be applicable to the MyEclipse code base?
    I’m thinking that you guys have modified the Hibernate Tools code generator slightly, as your code produces different results from the Hibernate Tools.

    #257932 Reply

    Riyad Kalla
    Member

    Yes we have modified it quite a bit, I don’t know that it would be a drop in fix, but ti wouldn’t hurt if the fix was easy enough (that was if we did a refresh on HT it would come over automatically)

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Hibernate generate POJO and Boolean methods

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