Examples of MetadataFactory


Examples of com.volantis.shared.metadata.MetaDataFactory

    /**
     * Test that null values are rejected when they are not allowed.
     */
    public void testNullValuesRejected() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        String key = "key";

        BooleanValue value = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        // create the map
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           value.getClass(), false);
        try {
View Full Code Here

Examples of com.volantis.shared.metadata.MetaDataFactory

    /**
     * Test that null keys are accepted when they are allowed.
     */
    public void testNullValuesAccepted() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        String key = "key";

        BooleanValue value = (BooleanValue) f.getValueFactory()
            .createBooleanValue();
        // create the map
        TypedMap typedMap = createTypedMap(new HashMap(),
                                           value.getClass(), true);
        typedMap.put(key, null);
View Full Code Here

Examples of com.volantis.shared.metadata.MetaDataFactory

    /**
     * Tests that the typed list only accepts allowable types.
     */
    public void testSetOnlyStoresAllowableTypes() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        MutableBooleanValue allowableObject = (MutableBooleanValue) f.getValueFactory()
            .createBooleanValue().createMutable();
        allowableObject.setValue(Boolean.TRUE);

        NumberValue unallowableObject = (NumberValue) f.getValueFactory()
            .createNumberValue();

        TypedSet typedSet = new TypedSet(new HashSet(), BooleanValue.class);

        try {
View Full Code Here

Examples of com.volantis.shared.metadata.MetaDataFactory

    /**
     * Tests that the typed list only accepts allowable types.
     */
    public void testListOnlyStoresAllowableTypes() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        MutableBooleanValue allowableObject = (MutableBooleanValue) f.getValueFactory()
            .createBooleanValue().createMutable();
        allowableObject.setValue(Boolean.TRUE);

        NumberValue unallowableObject = (NumberValue) f.getValueFactory()
            .createNumberValue();

        TypedList typedList = new TypedList(new ArrayList(), BooleanValue.class);

        try {
View Full Code Here

Examples of com.volantis.shared.metadata.MetaDataFactory

     * Tests that we are not allowed to add objects of the wrong type, and are
     * allowed to add objects of the correct type on the <code>ListIterator</code>
     * provided by {@link TypedList#iterator}.
     */
    public void testIteratorOnlyAddsAllowableTypes() {
        MetaDataFactory f = MetaDataFactory.getDefaultInstance();
        MutableBooleanValue allowableObject = (MutableBooleanValue) f.getValueFactory()
            .createBooleanValue().createMutable();
        allowableObject.setValue(Boolean.TRUE);

        NumberValue unallowableObject = (NumberValue) f.getValueFactory()
            .createNumberValue();
        TypedList typedList = new TypedList(new ArrayList(), BooleanValue.class);
        ListIterator iterator = typedList.listIterator();

        // check that the list iterator will allow an permitted type to be added
View Full Code Here

Examples of org.apache.openjpa.meta.MetaDataFactory

     * create a new repository and sets it.
     */
    public MetaDataRepository getRepository() {
        if (_repos == null) {
            MetaDataRepository repos = _conf.newMetaDataRepositoryInstance();
            MetaDataFactory mdf = repos.getMetaDataFactory();
            if (mdf instanceof DelegatingMetaDataFactory)
                mdf = ((DelegatingMetaDataFactory) mdf).getInnermostDelegate();
            if (mdf instanceof PersistenceMetaDataFactory)
                ((PersistenceMetaDataFactory) mdf).setAnnotationParser(this);
            _repos = repos;
View Full Code Here

Examples of org.apache.openjpa.meta.MetaDataFactory

        {
            mappings[i].setResolve(MODE_META | MODE_MAPPING, true);
            mappings[i].setUseSchemaElement(getUseSchemaElement());
        }
        // store in user's configured IO
        MetaDataFactory mdf = _conf.newMetaDataFactoryInstance();
        mdf.setRepository(getRepository());
        mdf.setStoreDirectory(_dir);
        if (perClass)
            mdf.setStoreMode(MetaDataFactory.STORE_PER_CLASS);
        mdf.store(mappings, new QueryMetaData[0], new SequenceMetaData[0],
            MODE_META | MODE_MAPPING, output);

        Set files = new TreeSet();
        for (int i = 0; i < mappings.length; i++)
            if (mappings[i].getSourceFile() != null)
View Full Code Here

Examples of org.apache.openjpa.meta.MetaDataFactory

        {
            mappings[i].setResolve(MODE_META | MODE_MAPPING, true);
            mappings[i].setUseSchemaElement(getUseSchemaElement());
        }
        // 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;
    }
View Full Code Here

Examples of org.apache.openjpa.meta.MetaDataFactory

     * a new repository and sets it.
     */
    public MetaDataRepository getRepository() {
        if (_repos == null) {
            MetaDataRepository repos = _conf.newMetaDataRepositoryInstance();
            MetaDataFactory mdf = repos.getMetaDataFactory();
            if (mdf instanceof DelegatingMetaDataFactory)
                mdf = ((DelegatingMetaDataFactory) mdf).getInnermostDelegate();
            if (mdf instanceof PersistenceMetaDataFactory)
                ((PersistenceMetaDataFactory) mdf).setXMLParser(this);
            _repos = repos;
View Full Code Here

Examples of org.apache.openjpa.meta.MetaDataFactory

     * create a new repository and sets it.
     */
    public MetaDataRepository getRepository() {
        if (_repos == null) {
            MetaDataRepository repos = _conf.newMetaDataRepositoryInstance();
            MetaDataFactory mdf = repos.getMetaDataFactory();
            if (mdf instanceof DelegatingMetaDataFactory)
                mdf = ((DelegatingMetaDataFactory) mdf).getInnermostDelegate();
            if (mdf instanceof PersistenceMetaDataFactory)
                ((PersistenceMetaDataFactory) mdf).setAnnotationParser(this);
            _repos = repos;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.