1 package org.apache.ojb.broker.core.proxy; 2 3 17 18 import java.util.Collection ; 19 import java.util.Set ; 20 21 import org.apache.ojb.broker.PBKey; 22 import org.apache.ojb.broker.PersistenceBrokerException; 23 import org.apache.ojb.broker.query.Query; 24 import org.apache.ojb.broker.util.collections.ManageableHashSet; 25 26 33 public class SetProxyDefaultImpl extends CollectionProxyDefaultImpl implements Set 34 { 35 36 41 public SetProxyDefaultImpl(PBKey aKey, Query aQuery) 42 { 43 this(aKey, ManageableHashSet.class, aQuery); 44 } 45 46 52 public SetProxyDefaultImpl(PBKey aKey, Class aCollClass, Query aQuery) 53 { 54 super(aKey, aCollClass, aQuery); 55 } 56 57 protected Set getSetData() 58 { 59 return (Set )super.getData(); 60 } 61 62 65 protected Collection loadData() throws PersistenceBrokerException 66 { 67 Collection result = super.loadData(); 68 69 if (result instanceof Set ) 70 { 71 return result; 72 } 73 else 74 { 75 throw new PersistenceBrokerException("loaded data does not implement java.util.Set"); 76 } 77 78 } 79 80 } 81 | Popular Tags |