package com.idega.core.component.data; import java.util.Collection; import javax.ejb.CreateException; import javax.ejb.FinderException; import com.idega.data.IDOEntity; import com.idega.data.IDOFactory; public class ICObjectHomeImpl extends IDOFactory implements ICObjectHome { public Class getEntityInterfaceClass() { return ICObject.class; } public ICObject create() throws CreateException { return (ICObject) super.createIDO(); } public ICObject findByPrimaryKey(Object pk) throws FinderException { return (ICObject) super.findByPrimaryKeyIDO(pk); } public Collection findAll() throws FinderException { IDOEntity entity = this.idoCheckOutPooledEntity(); Collection ids = ((ICObjectBMPBean) entity).ejbFindAll(); this.idoCheckInPooledEntity(entity); return this.getEntityCollectionForPrimaryKeys(ids); } public Collection findAllByObjectType(String type) throws FinderException { IDOEntity entity = this.idoCheckOutPooledEntity(); Collection ids = ((ICObjectBMPBean) entity).ejbFindAllByObjectType(type); this.idoCheckInPooledEntity(entity); return this.getEntityCollectionForPrimaryKeys(ids); } public Collection findAllByObjectTypeOrdered(String type) throws FinderException { IDOEntity entity = this.idoCheckOutPooledEntity(); Collection ids = ((ICObjectBMPBean) entity).ejbFindAllByObjectTypeOrdered(type); this.idoCheckInPooledEntity(entity); return this.getEntityCollectionForPrimaryKeys(ids); } public Collection findAllByObjectTypeAndBundle(String type, String bundle) throws FinderException { IDOEntity entity = this.idoCheckOutPooledEntity(); Collection ids = ((ICObjectBMPBean) entity).ejbFindAllByObjectTypeAndBundle(type, bundle); this.idoCheckInPooledEntity(entity); return this.getEntityCollectionForPrimaryKeys(ids); } public Collection findAllByBundle(String bundle) throws FinderException { IDOEntity entity = this.idoCheckOutPooledEntity(); Collection ids = ((ICObjectBMPBean) entity).ejbFindAllByBundle(bundle); this.idoCheckInPooledEntity(entity); return this.getEntityCollectionForPrimaryKeys(ids); } public ICObject findByClassName(String className) throws FinderException { IDOEntity entity = this.idoCheckOutPooledEntity(); Object pk = ((ICObjectBMPBean) entity).ejbFindByClassName(className); this.idoCheckInPooledEntity(entity); return this.findByPrimaryKey(pk); } public Collection findAllBlocksByBundle(String bundle) throws FinderException { IDOEntity entity = this.idoCheckOutPooledEntity(); Collection ids = ((ICObjectBMPBean) entity).ejbFindAllBlocksByBundle(bundle); this.idoCheckInPooledEntity(entity); return this.getEntityCollectionForPrimaryKeys(ids); } public Collection findAllBlocks() throws FinderException { IDOEntity entity = this.idoCheckOutPooledEntity(); Collection ids = ((ICObjectBMPBean) entity).ejbFindAllBlocks(); this.idoCheckInPooledEntity(entity); return this.getEntityCollectionForPrimaryKeys(ids); } public Collection findAllElementsByBundle(String bundle) throws FinderException { IDOEntity entity = this.idoCheckOutPooledEntity(); Collection ids = ((ICObjectBMPBean) entity).ejbFindAllElementsByBundle(bundle); this.idoCheckInPooledEntity(entity); return this.getEntityCollectionForPrimaryKeys(ids); } public Collection findAllElements() throws FinderException { IDOEntity entity = this.idoCheckOutPooledEntity(); Collection ids = ((ICObjectBMPBean) entity).ejbFindAllElements(); this.idoCheckInPooledEntity(entity); return this.getEntityCollectionForPrimaryKeys(ids); } }