Package org.apache.ojb.broker.metadata

Examples of org.apache.ojb.broker.metadata.ClassDescriptor


    // helper methods
    //============================================================================

    void changeAutoSetting(Class clazz, String referenceField, boolean autoRetrieve, boolean autoUpdate, boolean autoDelete, boolean useProxy)
    {
        ClassDescriptor cld = broker.getClassDescriptor(clazz);
        ObjectReferenceDescriptor ref = cld.getCollectionDescriptorByName(referenceField);
        if(ref == null) ref = cld.getObjectReferenceDescriptorByName(referenceField);
        ref.setLazy(useProxy);
        ref.setCascadeRetrieve(autoRetrieve);
        ref.setCascadeStore(autoUpdate);
        ref.setCascadeDelete(autoDelete);
    }
View Full Code Here


        ref.setCascadeDelete(autoDelete);
    }

    void changeAutoSetting(Class clazz, String referenceField, boolean autoRetrieve, int autoUpdate, int autoDelete, boolean useProxy)
    {
        ClassDescriptor cld = broker.getClassDescriptor(clazz);
        ObjectReferenceDescriptor ref = cld.getCollectionDescriptorByName(referenceField);
        if(ref == null) ref = cld.getObjectReferenceDescriptorByName(referenceField);
        ref.setLazy(useProxy);
        ref.setCascadeRetrieve(autoRetrieve);
        ref.setCascadingStore(autoUpdate);
        ref.setCascadingDelete(autoDelete);
    }
View Full Code Here

    public void testSerializedObjectsRefreshWithProxy()
    {
        String prefix = "testSerializedObjectsRefreshWithProxy_" + System.currentTimeMillis() + "_";

        ClassDescriptor cld = broker.getClassDescriptor(ObjectRepository.Component.class);
        ObjectReferenceDescriptor ord = cld.getObjectReferenceDescriptorByName("parentComponent");
        boolean oldState = ord.isLazy();
        try
        {
            ord.setLazy(true);
            ObjectRepository.Component parent = new ObjectRepository.Component();
View Full Code Here

        return a;
    }

    void changeActorCollectionDescriptorTo(boolean autoRetrieve, int autoUpdate, int autoDelete, boolean proxy)
    {
        ClassDescriptor cld = broker.getClassDescriptor(Actor.class);
        CollectionDescriptor cod = (CollectionDescriptor) cld.getCollectionDescriptors().get(0);
        cod.setLazy(proxy);
        cod.setCascadeRetrieve(autoRetrieve);
        cod.setCascadingStore(autoUpdate);
        cod.setCascadingDelete(autoDelete);
    }
View Full Code Here

        cod.setCascadingDelete(autoDelete);
    }

    void changeActorCollectionDescriptorTo(boolean autoRetrieve, boolean autoUpdate, boolean autoDelete, boolean proxy)
    {
        ClassDescriptor cld = broker.getClassDescriptor(Actor.class);
        CollectionDescriptor cod = (CollectionDescriptor) cld.getCollectionDescriptors().get(0);
        cod.setLazy(proxy);
        cod.setCascadeRetrieve(autoRetrieve);
        cod.setCascadeStore(autoUpdate);
        cod.setCascadeDelete(autoDelete);
    }
View Full Code Here

        cod.setCascadeDelete(autoDelete);
    }

    void changeMovieCollectionDescriptorTo(boolean autoRetrieve, int autoUpdate, int autoDelete, boolean proxy)
    {
        ClassDescriptor cld = broker.getClassDescriptor(MovieImpl.class);
        CollectionDescriptor cod = (CollectionDescriptor) cld.getCollectionDescriptors().get(0);
        cod.setLazy(proxy);
        cod.setCascadeRetrieve(autoRetrieve);
        cod.setCascadingStore(autoUpdate);
        cod.setCascadingDelete(autoDelete);
    }
View Full Code Here

    }

    public void setUp() throws Exception
    {
        super.setUp();
        ClassDescriptor cld = MetadataManager.getInstance().getRepository().getDescriptorFor(ProductGroup.class);
        cld.getCollectionDescriptorByName("allArticlesInGroup").setCascadeStore(false);
    }
View Full Code Here

        cld.getCollectionDescriptorByName("allArticlesInGroup").setCascadeStore(false);
    }

    public void tearDown() throws Exception
    {
        ClassDescriptor cld = MetadataManager.getInstance().getRepository().getDescriptorFor(ProductGroup.class);
        cld.getCollectionDescriptorByName("allArticlesInGroup").setCascadeStore(false);
        super.tearDown();
    }
View Full Code Here

        }
    }

    private void setReferenceMetadata(Class clazz, String reference, boolean autoretrieve, int autoupdate, int autodelete, boolean useProxy)
    {
        ClassDescriptor cld = broker.getClassDescriptor(clazz);
        ObjectReferenceDescriptor ord = cld.getObjectReferenceDescriptorByName(reference);
        if(ord == null)
        {
            ord = cld.getCollectionDescriptorByName(reference);
        }
        if(ord == null)
        {
            throw new MetadataException("Reference with name '" + reference + "' does not exist in " + clazz.getName());
        }
View Full Code Here

     * changes, nothing should happen.
     */
    public void testNull_0_Complex() throws Exception
    {
        Class objClass = ObjectRepository.E.class;
        ClassDescriptor cld = broker.getClassDescriptor(objClass);
        Integer someOtherValue = new Integer(1111111111);
        String insert = "INSERT INTO TABLE_E VALUES(0,"+someOtherValue.intValue()+")";
        String delete = "DELETE FROM TABLE_E WHERE ID=0";
        Statement stmt;
        try
View Full Code Here

TOP

Related Classes of org.apache.ojb.broker.metadata.ClassDescriptor

Copyright © 2018 www.massapicom. 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.