openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anand213 <akumar...@bankofamerica.com>
Subject ReverseMappingTool - Sequence Annotation
Date Fri, 01 Feb 2013 17:47:58 GMT
HI,

I am unable to generate below annotations for sequences using the mapping
tool. I am using a Database and not xml file to generate the classes from.
        
       @Id
       @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator="AdminSeq")
       @SequenceGenerator(name="AdminSeq" sequence="adminGroup_seq")
        private int adminGroup; 

I tried to use a customizer class and overridden below method, but unable to
generate the annotation. 

public void customize(FieldMapping field)

In buildAnnotations() method of ReverseMappingTool.java it always passes an
empty sequence metadata array "new SequenceMetaData[0]"


public void buildAnnotations() {
        Map output = new HashMap();
        // pretend mappings are all resolved
        ClassMapping[] mappings = getMappings();
        for (int i = 0; i < mappings.length; i++)
            mappings[i].setResolve(MODE_META | MODE_MAPPING, true);

        // store in user's configured IO
        MetaDataFactory mdf = _conf.newMetaDataFactoryInstance();
        mdf.setRepository(getRepository());
        mdf.setStoreDirectory(_dir);
        mdf.store(mappings, new QueryMetaData[0], new SequenceMetaData[0],
            MODE_META | MODE_MAPPING | MODE_ANN_MAPPING, output);
        _annos = output;
    }


Pls advice is there is s way to achieve this.

Thanks,
AKumar



--
View this message in context: http://openjpa.208410.n2.nabble.com/ReverseMappingTool-Sequence-Annotation-tp7582689.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Mime
View raw message