Package org.apache.cayenne.reflect

Examples of org.apache.cayenne.reflect.LifecycleCallbackRegistry.addListener()


        Artist a1 = context.newObject(Artist.class);
        a1.setArtistName("XX");
        context.commitChanges();
        assertFalse(a1.isPostPersisted());

        registry.addListener(
                LifecycleEvent.POST_PERSIST,
                Artist.class,
                "postPersistCallback");
        MockCallingBackListener listener2 = new MockCallingBackListener() {
View Full Code Here


            public void publicCallback(Object entity) {
                super.publicCallback(entity);
                assertFalse(((Persistent) entity).getObjectId().isTemporary());
            }
        };
        registry.addListener(
                LifecycleEvent.POST_PERSIST,
                Artist.class,
                listener2,
                "publicCallback");
View Full Code Here

                            .getCallbackMap()
                            .getCallbacks();
                    for (CallbackDescriptor callback : callbacks) {

                        for (String method : callback.getCallbackMethods()) {
                            callbackRegistry.addListener(
                                    callback.getCallbackType(),
                                    entityClass,
                                    listenerInstance,
                                    method);
                        }
View Full Code Here

                }

                CallbackDescriptor[] callbacks = entity.getCallbackMap().getCallbacks();
                for (CallbackDescriptor callback : callbacks) {
                    for (String method : callback.getCallbackMethods()) {
                        callbackRegistry.addListener(
                                callback.getCallbackType(),
                                entityClass,
                                method);
                    }
                }
View Full Code Here

                            .getCallbackMap()
                            .getCallbacks();
                    for (CallbackDescriptor callback : callbacks) {

                        for (String method : callback.getCallbackMethods()) {
                            callbackRegistry.addListener(
                                    callback.getCallbackType(),
                                    entityClass,
                                    listenerInstance,
                                    method);
                        }
View Full Code Here

                }

                CallbackDescriptor[] callbacks = entity.getCallbackMap().getCallbacks();
                for (CallbackDescriptor callback : callbacks) {
                    for (String method : callback.getCallbackMethods()) {
                        callbackRegistry.addListener(
                                callback.getCallbackType(),
                                entityClass,
                                method);
                    }
                }
View Full Code Here

                            .getCallbackMap()
                            .getCallbacks();
                    for (CallbackDescriptor callback : callbacks) {

                        for (String method : callback.getCallbackMethods()) {
                            callbackRegistry.addListener(
                                    callback.getCallbackType(),
                                    entityClass,
                                    listenerInstance,
                                    method);
                        }
View Full Code Here

                }

                CallbackDescriptor[] callbacks = entity.getCallbackMap().getCallbacks();
                for (CallbackDescriptor callback : callbacks) {
                    for (String method : callback.getCallbackMethods()) {
                        callbackRegistry.addListener(
                                callback.getCallbackType(),
                                entityClass,
                                method);
                    }
                }
View Full Code Here

                .getEntityResolver()
                .getCallbackRegistry();

        ObjectContext context = createDataContext();

        registry.addListener(LifecycleEvent.POST_LOAD, Artist.class, "postLoadCallback");
        MockCallingBackListener listener = new MockCallingBackListener();
        registry.addListener(
                LifecycleEvent.POST_LOAD,
                Artist.class,
                listener,
View Full Code Here

        ObjectContext context = createDataContext();

        registry.addListener(LifecycleEvent.POST_LOAD, Artist.class, "postLoadCallback");
        MockCallingBackListener listener = new MockCallingBackListener();
        registry.addListener(
                LifecycleEvent.POST_LOAD,
                Artist.class,
                listener,
                "publicCallback");
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.