You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by anand213 <ak...@bankofamerica.com> on 2013/02/01 18:47:58 UTC

ReverseMappingTool - Sequence Annotation

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.