Examples of KunderaProxy


Examples of com.impetus.kundera.proxy.KunderaProxy

    @Test
    public void testisLoadedWithReferenceAsKunderaProxy() throws NoSuchMethodException, SecurityException
    {
        CglibLazyInitializerFactory factory = new CglibLazyInitializerFactory();
        KunderaProxy proxy = factory.getProxy("Person", Person.class,
                Person.class.getDeclaredMethod("getPersonId", null),
                Person.class.getDeclaredMethod("setPersonId", String.class), "personId", null);

        LoadState state = PersistenceUtilHelper.isLoadedWithReference(proxy, "personId", cache);
View Full Code Here

Examples of com.impetus.kundera.proxy.KunderaProxy

    @Test
    public void testisLoadedWithOutReferenceAsKunderaProxy() throws NoSuchMethodException, SecurityException
    {
        CglibLazyInitializerFactory factory = new CglibLazyInitializerFactory();
        KunderaProxy proxy = factory.getProxy("Person", Person.class,
                Person.class.getDeclaredMethod("getPersonId", null),
                Person.class.getDeclaredMethod("setPersonId", String.class), "personId", null);

        LoadState state = PersistenceUtilHelper.isLoadedWithoutReference(proxy, "personName", cache);
View Full Code Here

Examples of com.impetus.kundera.proxy.KunderaProxy

   
    @Test
    public void testisLoadedWAsKunderaProxy() throws NoSuchMethodException, SecurityException
    {
        CglibLazyInitializerFactory factory = new CglibLazyInitializerFactory();
        KunderaProxy proxy = factory.getProxy("Person", Person.class,
                Person.class.getDeclaredMethod("getPersonId", null),
                Person.class.getDeclaredMethod("setPersonId", String.class), "personId", null);

        LoadState state = PersistenceUtilHelper.isLoaded(proxy);
View Full Code Here

Examples of com.impetus.kundera.proxy.KunderaProxy

    {

        final CglibLazyInitializer instance = new CglibLazyInitializer(entityName, persistentClass, interfaces, id,
                getIdentifierMethod, setIdentifierMethod, pd);

        final KunderaProxy proxy;
        Class factory = getProxyFactory(persistentClass, interfaces);

        proxy = getProxyInstance(factory, instance);

        instance.constructed = true;
View Full Code Here

Examples of com.impetus.kundera.proxy.KunderaProxy

     * @throws IllegalAccessException
     *             the illegal access exception
     */
    private static KunderaProxy getProxyInstance(Class factory, CglibLazyInitializer instance)
    {
        KunderaProxy proxy;
        try
        {
            Enhancer.registerCallbacks(factory, new Callback[] { instance, null });
            proxy = (KunderaProxy) factory.newInstance();
        }
View Full Code Here

Examples of com.impetus.kundera.proxy.KunderaProxy

                Object owner = null;

                String entityName = m.getEntityClazz().getName() + "_" + entityId + "#"
                        + relation.getProperty().getName();

                KunderaProxy kp = kunderaMetadata.getCoreMetadata().getLazyInitializerFactory().getProxy(entityName);

                if (kp != null)
                {
                    owner = kp.getKunderaLazyInitializer().getOwner();
                    if (owner != null && owner.getClass().equals(parentEntityMetadata.getEntityClazz()))
                    {

                        relationValue = PropertyAccessorHelper.getId(owner, parentEntityMetadata);
                    }
View Full Code Here

Examples of com.impetus.kundera.proxy.KunderaProxy

    @Override
    public KunderaProxy getProxy(String entityName, Class<?> persistentClass, Method getIdentifierMethod,
            Method setIdentifierMethod, Object id, PersistenceDelegator pd)
    {
        KunderaProxy kunderaProxy = (KunderaProxy) CglibLazyInitializer.getProxy(entityName, persistentClass,
                new Class[] { KunderaProxy.class }, getIdentifierMethod, setIdentifierMethod, id, pd);
        proxies.put(entityName, kunderaProxy);

        return kunderaProxy;
    }
View Full Code Here

Examples of com.impetus.kundera.proxy.KunderaProxy

                    if (r.isUnary())
                    {
                        String entityName = entityMetadata.getEntityClazz().getName() + "_" + entityId + "#"
                                + r.getProperty().getName();

                        KunderaProxy kunderaProxy = getProxy(entityName);
                        if (kunderaProxy != null)
                        {
                            kunderaProxy.getKunderaLazyInitializer().setOwner(e);
                        }
                    }
                }
            }
        }
View Full Code Here

Examples of com.impetus.kundera.proxy.KunderaProxy

    @Test
    public void testGetProxy()
    {

        LazyInitializerFactory factory = kunderaMetadata.getCoreMetadata().getLazyInitializerFactory();
        KunderaProxy proxy = factory.getProxy("personnel", PersonnelDTO.class, null, null, "1", null);
        LazyInitializer li = proxy.getKunderaLazyInitializer();
        Assert.assertEquals(CglibLazyInitializer.class, li.getClass());
        Assert.assertTrue(li.isUninitialized());
        Assert.assertFalse(li.isUnwrap());
        Assert.assertEquals("personnel", li.getEntityName());
        Assert.assertEquals("1", li.getIdentifier());
View Full Code Here

Examples of com.impetus.kundera.proxy.KunderaProxy

    @Test
    public void testWithNullPD()
    {

        LazyInitializerFactory factory = kunderaMetadata.getCoreMetadata().getLazyInitializerFactory();
        KunderaProxy proxy = factory.getProxy("personnel", PersonnelDTO.class, null, null, "1", null);
        LazyInitializer li = proxy.getKunderaLazyInitializer();
        Assert.assertEquals(CglibLazyInitializer.class, li.getClass());
       
        try
        {
            li.initialize();
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.