-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: reverseengineeringstrategy gen-property constructor
PostPosted: Tue Mar 18, 2008 7:58 am 
Newbie

Joined: Tue Mar 18, 2008 5:55 am
Posts: 1
Hi,

i'm using a ReverseEngineeringStrategy (over a delegate as mentioned in the docs) and trying to disable some of the properties with the following code-construct in my ReverseEngineeringStrategy:

Code:
public Map<String, MetaAttribute> columnToMetaAttributes(TableIdentifier identifier, String column) {

    Map<String, MetaAttribute> metaMap = new HashMap<String, MetaAttribute>();
    String propertyName = super.columnToPropertyName(identifier, column);

    /*
     * Ignore all properties which starts with 'S'.
     */
    if(propertyName != null && propertyName.startsWith("S")) {
        MetaAttribute metaAtt = new MetaAttribute("gen-property");
        metaAtt.addValue("false");
        metaMap.put("gen-property", metaAtt);
    } else {
        metaAtt = super.columnToMetaAttributes(identifier, column);
    }
    return metaAtt;
}


This code works fine and ignores all the properties as membervariables. But now i recognized that theese properties are still in the 'all-properties' constructor:

example:
Code:
class Person {
    private String name;
    private String surname;
    //my ignored variable --> text/member isn't visible in the generated pojo
    //private String stime;

    //no-argument-constructor
    public Person() {}

    //all-properties-constructor
    public Person(String name, String surname, String stime) {
        this.name = name;
        this.surname = surname;
        this.stime = stime;     //Compiler-Error
    }
}


Until now i haven't find anything helpful. Is there a possibility to fix this problem?

Thanks in advance
Alex


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 19, 2008 1:30 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
Its a bug... I have already reported that in JIRA. The gen-property, though eliminates the member variable, It appears in the constructor and gives a compiler error. The issue has not been fixed yet.

_________________
Sukirtha


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.