Package org.apache.ojb.broker.metadata

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


        assertEquals(1, retrievednodeB.getParents().size());
    }

    void changeRelationMetadata(String field, boolean autoRetrieve, int autoUpdate, int autoDelete, boolean proxy)
    {
        ClassDescriptor cld = broker.getClassDescriptor(Node.class);
        CollectionDescriptor cod = (CollectionDescriptor) cld.getCollectionDescriptorByName(field);
        cod.setLazy(proxy);
        cod.setCascadeRetrieve(autoRetrieve);
        cod.setCascadingStore(autoUpdate);
        cod.setCascadingDelete(autoDelete);
    }
View Full Code Here


    }

    void changeActorCollectionDescriptorTo(boolean autoRetrieve, int autoUpdate, int autoDelete, boolean proxy)
    {
        PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
        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);
        broker.close();
View Full Code Here

    }

    void changeMovieCollectionDescriptorTo(boolean autoRetrieve, int autoUpdate, int autoDelete, boolean proxy)
    {
        PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
        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);
        broker.close();
View Full Code Here

    /**
     * Store m-side and intermediary
     */
    public void testStoringWithAutoUpdateFalse1()
    {
        ClassDescriptor cld = broker.getClassDescriptor(Paper.class);
        CollectionDescriptor cod = cld.getCollectionDescriptorByName("qualifiers");
        boolean autoUpdate = cod.getCascadeStore();

        cod.setCascadeStore(false);

        try
View Full Code Here

     * Store m-side, intermediary and n-side
     * n-side forced by using broker.store()
     */
    public void testStoringWithAutoUpdateFalse2()
    {
        ClassDescriptor cld = broker.getClassDescriptor(Paper.class);
        CollectionDescriptor cod = cld.getCollectionDescriptorByName("qualifiers");
        boolean autoUpdate = cod.getCascadeStore();

        cod.setCascadeStore(false);

        try
View Full Code Here

    /**
     * Store m-side, intermediary and n-side
     */
    public void testStoringWithAutoUpdateTrue()
    {
        ClassDescriptor cld = broker.getClassDescriptor(Paper.class);
        CollectionDescriptor cod = cld.getCollectionDescriptorByName("qualifiers");
        boolean autoUpdate = cod.getCascadeStore();

        cod.setCascadeStore(true);

        try
View Full Code Here


    // delete from intermediary table only when collection NOT removal aware
    public void testDelete_NonRemovalAware()
    {
        ClassDescriptor cld = broker.getClassDescriptor(Paper.class);
        CollectionDescriptor cod = cld.getCollectionDescriptorByName("qualifiers");
        Class collectionClass = cod.getCollectionClass();

        cod.setCollectionClass(ManageableArrayList.class);

        try
View Full Code Here

    }

    // delete from intermediary AND target-table when collection removal aware
    public void testDelete_RemovalAware()
    {
        ClassDescriptor cld = broker.getClassDescriptor(Paper.class);
        CollectionDescriptor cod = cld.getCollectionDescriptorByName("qualifiers");
        Class collectionClass = cod.getCollectionClass();

        cod.setCollectionClass(RemovalAwareCollection.class);

        try
View Full Code Here

        assertEquals("Wrong number of References", 6, result.size());
    }

    private void changeRepositoryAutoSetting(String attributeName, boolean retrieve, int update, int delete)
    {
        ClassDescriptor cld = broker.getClassDescriptor(Repository.class);
        ObjectReferenceDescriptor ord = cld.getObjectReferenceDescriptorByName(attributeName);
        ord.setCascadeRetrieve(retrieve);
        ord.setCascadingStore(update);
        ord.setCascadingDelete(delete);
    }
View Full Code Here

        ord.setCascadingDelete(delete);
    }

    private void changeRepositoryAutoSetting(String attributeName, boolean retrieve, boolean update, boolean delete)
    {
        ClassDescriptor cld = broker.getClassDescriptor(Repository.class);
        ObjectReferenceDescriptor ord = cld.getObjectReferenceDescriptorByName(attributeName);
        ord.setCascadeRetrieve(retrieve);
        ord.setCascadeStore(update);
        ord.setCascadeDelete(delete);
    }
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.