Search in sources :

Example 26 with Proxy

use of javassist.util.proxy.Proxy in project mybatis-3 by mybatis.

the class JavassistProxyTest method shouldCreateAProxyForAPartiallyLoadedBean.

@Test
public void shouldCreateAProxyForAPartiallyLoadedBean() throws Exception {
    ResultLoaderMap loader = new ResultLoaderMap();
    loader.addLoader("id", null, null);
    Object proxy = proxyFactory.createProxy(author, loader, new Configuration(), new DefaultObjectFactory(), new ArrayList<Class<?>>(), new ArrayList<Object>());
    Author author2 = (Author) deserialize(serialize((Serializable) proxy));
    assertTrue(author2 instanceof Proxy);
}
Also used : Proxy(javassist.util.proxy.Proxy) Configuration(org.apache.ibatis.session.Configuration) DefaultObjectFactory(org.apache.ibatis.reflection.factory.DefaultObjectFactory) Author(org.apache.ibatis.domain.blog.Author) Test(org.junit.Test)

Aggregations

Proxy (javassist.util.proxy.Proxy)26 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)8 ODatabaseObject (com.orientechnologies.orient.core.db.object.ODatabaseObject)5 OIdentifiable (com.orientechnologies.orient.core.db.record.OIdentifiable)5 HashMap (java.util.HashMap)5 Map (java.util.Map)5 ProxyObject (javassist.util.proxy.ProxyObject)5 Test (org.junit.Test)5 ORecordId (com.orientechnologies.orient.core.id.ORecordId)4 OObjectDatabaseTx (com.orientechnologies.orient.object.db.OObjectDatabaseTx)4 OObjectProxyMethodHandler (com.orientechnologies.orient.object.enhancement.OObjectProxyMethodHandler)4 EnumTest (com.orientechnologies.orient.test.domain.base.EnumTest)4 JavaAttachDetachTestClass (com.orientechnologies.orient.test.domain.base.JavaAttachDetachTestClass)4 Child (com.orientechnologies.orient.test.domain.business.Child)4 HashSet (java.util.HashSet)4 Set (java.util.Set)4 ProxyFactory (javassist.util.proxy.ProxyFactory)3 BaseDataTest (org.apache.ibatis.BaseDataTest)3 Test (org.testng.annotations.Test)3 OObjectLazyMultivalueElement (com.orientechnologies.orient.core.db.object.OObjectLazyMultivalueElement)2