FileDocCategorySizeDatePackage
ProxyHelper.javaAPI DocHibernate 3.2.52161Tue Dec 06 14:23:38 GMT 2005org.hibernate.test.dynamicentity

ProxyHelper

public class ProxyHelper extends Object
author
Steve Ebersole

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.StringextractEntityName(java.lang.Object object)

		// Our custom java.lang.reflect.Proxy instances actually bundle
		// their appropriate entity name, so we simply extract it from there
		// if this represents one of our proxies; otherwise, we return null
		if ( Proxy.isProxyClass( object.getClass() ) ) {
			InvocationHandler handler = Proxy.getInvocationHandler( object );
			if ( DataProxyHandler.class.isAssignableFrom( handler.getClass() ) ) {
				DataProxyHandler myHandler = ( DataProxyHandler ) handler;
				return myHandler.getEntityName();
			}
		}
		return null;
	
public static AddressnewAddressProxy()

		return newAddressProxy( null );
	
public static AddressnewAddressProxy(java.io.Serializable id)

		return ( Address ) Proxy.newProxyInstance(
				Address.class.getClassLoader(),
		        new Class[] {Address.class},
		        new DataProxyHandler( Address.class.getName(), id )
		);
	
public static CompanynewCompanyProxy()

		return newCompanyProxy( null );
	
public static CompanynewCompanyProxy(java.io.Serializable id)

		return ( Company ) Proxy.newProxyInstance(
				Company.class.getClassLoader(),
		        new Class[] {Company.class},
		        new DataProxyHandler( Company.class.getName(), id )
		);
	
public static CustomernewCustomerProxy()

		return newCustomerProxy( null );
	
public static CustomernewCustomerProxy(java.io.Serializable id)

		return ( Customer ) Proxy.newProxyInstance(
				Customer.class.getClassLoader(),
		        new Class[] {Customer.class},
		        new DataProxyHandler( Customer.class.getName(), id )
		);
	
public static PersonnewPersonProxy()

		return newPersonProxy( null );
	
public static PersonnewPersonProxy(java.io.Serializable id)

		return ( Person ) Proxy.newProxyInstance(
				Person.class.getClassLoader(),
		        new Class[] {Person.class},
		        new DataProxyHandler( Person.class.getName(), id )
		);