facebook

JPA Reverse Engineering POJO member variable names

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

    Sean Parsons
    Member

    It seems that when the JPA rev engy process creates the POJO classes, it creates the member variables – that reference other reverse engy objects with UPPER case names.

    Example:
    Tables: Group, Person, Address

    1toN Person in Group and 1toN Address in Person…

    Address contains a Person member variable, but the problem is…

    private Person Person;

    This goes against convention. While thinking about changing it (manually), I have to change the setter classes to match that as well, and that’s a heck of a lot of work across a database with lots of tables.

    The sad/funny thing is, when I went to change the member variable back to “Person” from “person”, I get the following message:

    “The field name is discouraged. According to convetion, field names shold start with lowercase letters”…apparently JPA rev engy ignores this “convention”?

    Can you guys fix this???

    #286430 Reply

    Brian Fernandes
    Moderator

    I’d like you to confirm this for me, you’re saying all fields do not have this case problem, only fields which are references to other Entities are problematic?

    I tried this and could not replicate. What I saw generated was

    private Person person;

    . Can you tell me what database, and driver you are using?
    Also, in the @Table annotation for your entity, is the name attribute all upper (name = “PERSON”) or (name = “Person”)? Do you have case sensitive names for your tables?

    #286442 Reply

    Sean Parsons
    Member

    DB2 390 on the z/OS

    v. 8.1 FP14

    @Table name is uppercase. I do not believe so on the last question.

    However, if the object has a reference to other entities, it acls like the object var name is pretty much the exact same case as it’s object name.. like my simple example: private Person Person;

    It did this in 6.5M1, and just retried on GA..same issue.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: JPA Reverse Engineering POJO member variable names

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