| 1 package com.dotmarketing.cms.registration.factories; 2 3 import com.dotmarketing.beans.Tree; 4 import com.dotmarketing.db.DotHibernate; 5 import com.dotmarketing.util.Logger; 6 import com.liferay.portal.model.Address; 7 import com.dotmarketing.cms.registration.model.AddressProxy; 8 9 13 public class AddressProxyFactory { 14 15 public static AddressProxy getAddressProxy(String addressId) 16 { 17 try 18 { 19 DotHibernate dh = new DotHibernate(Tree.class); 20 dh.setQuery("from address_proxy in class com.dotmarketing.cms.registration.model.AddressProxy where addressId = ?"); 21 dh.setParam(addressId); 22 return (AddressProxy) dh.load(); 23 } 24 catch (Exception e) 25 { 26 Logger.warn(AddressProxyFactory.class, "getUserProxy failed:" + e, e); 27 } 28 return new AddressProxy(); 29 } 30 31 public static AddressProxy getAddressProxy(Address address) 32 { 33 return getAddressProxy(address.getAddressId()); 34 } 35 } 36 | Popular Tags |