facebook

Reverse enginering

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

    fix
    Member

    Dear,

    I’m reverse enginering from an existing Oracle schema. The first time I did this I forgot to rename all the fields to a custom name. As most people do, we have some strategy for naming our fields. I want to give them a friendly name for use in my java application. So I deleted all my classes and tried to reverse engineer them again, but he doesn’t use my custom names.
    I’m using myeclipse 5.1, I’m trying to generate the hibernate mappings with the Spring DAO template.

    Now when I look into the hibernate.reveng.xml file, the settings seem ok. Here’s one of my tables:

    
    <hibernate-reverse-engineering>
    
    <table name="AGENT" schema="VN" class="Agent">
        <primary-key>
            <generator class="assigned"></generator>
            <column name="AGENT_USERNAME" property="username" />
        </primary-key>
        <column name="AGENT_PASSWORD" property="password" />
        <column name="AGENT_NAME" property="name" />
        <column name="AGENT_EMAIL" property="email" />
        <column name="AGENT_ALERT_YN" property="alertYn" />
        <column name="AGENT_IMPC" property="impc" />
        <column name="AGENT_TYPE" property="type" />
    </table>
    

    So I reverse engeineer it and I still get a pojo like this:

    
    public class Agent  implements java.io.Serializable {
    
    
        // Fields    
    
         private String agentUsername;
         private String agentPassword;
         private String agentName;
         private String agentEmail;
         private String agentAlertYn;
         private String agentImpc;
         private String agentType;
    

    Anybody got a clue?

    Thnx

    #263895 Reply

    Haris Peco
    Member

    Could you try add your reveng.xml file in 2nd page of wizard (‘Rev-eng settings file’) ?

    Regards,

    #263899 Reply

    fix
    Member

    I couldn’t add the xml file because then the wizard would crash. Deleting the file and starting from scratch kinda worked (didn’t put the pojo’s in their correct package, but it created them with the properties I wanted!). So workaround is deleting it and starting over.

    Thnx for the quick reply

    #263900 Reply

    Brian Fernandes
    Moderator

    Fix,

    Can you elaborate what you meant by “the wizard would crash”? We’re getting ready for our next release and we’d like to be able to resolve this issue.

    Regarding the incorrect output packages, you need to specify the output package you desire on page 1 of the RE wizard – if you customized the class names for each table in the RE file, remember to use a fully qualified name instead of just the simple name.

    Hope this helps.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Reverse enginering

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