org.opensubsystems.blog.persist.db
Class EntryDatabaseFactory

java.lang.Object
  extended by org.opensubsystems.core.persist.db.DatabaseFactoryImpl
      extended by org.opensubsystems.blog.persist.db.EntryDatabaseFactory
All Implemented Interfaces:
EntryFactory, org.opensubsystems.core.persist.BasicDataFactory, org.opensubsystems.core.persist.DataFactory, org.opensubsystems.core.persist.db.BasicDatabaseFactory, org.opensubsystems.core.persist.db.DatabaseFactory, org.opensubsystems.core.persist.db.ModifiableDatabaseFactory, org.opensubsystems.core.persist.ModifiableDataFactory

public class EntryDatabaseFactory
extends org.opensubsystems.core.persist.db.DatabaseFactoryImpl
implements EntryFactory, org.opensubsystems.core.persist.db.ModifiableDatabaseFactory

Data factory to retrieve and manipulate entries in the persistence store.

Version:
$Id: EntryDatabaseFactory.java,v 1.15 2007/02/01 07:34:37 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
1.9 2006/07/26 00:27:07 jlegeny

Field Summary
protected  BlogDatabaseSchema m_schema
          Schema to use to execute database dependent operations.
 
Fields inherited from class org.opensubsystems.core.persist.db.DatabaseFactoryImpl
m_connectionFactory, m_iConcurrencySelectListResultSet, m_iDataType, m_iTypeSelectListResultSet, m_transactionFactory
 
Constructor Summary
EntryDatabaseFactory()
          Default constructor.
 
Method Summary
 int create(java.util.Collection colDataObject)
          
 org.opensubsystems.core.data.DataObject create(org.opensubsystems.core.data.DataObject data)
          
 void delete(int iId, int iDomainId)
          
 org.opensubsystems.core.data.DataObject get(int iId, int iDomainId)
          
 java.util.List getAll(int iBlogId)
          Get all entries from blog
 Entry getLast(int iBlogId)
          Get last added entry added to the specified blog
 org.opensubsystems.core.data.DataObject load(java.sql.ResultSet rsQueryResults, int initialIndex)
          
 org.opensubsystems.core.data.ModifiableDataObject save(org.opensubsystems.core.data.ModifiableDataObject data)
          
 int setValuesForInsert(java.sql.PreparedStatement insertStatement, org.opensubsystems.core.data.DataObject data, int iIndex)
          
 int setValuesForUpdate(java.sql.PreparedStatement updateStatement, org.opensubsystems.core.data.DataObject data, int iIndex)
          
 
Methods inherited from class org.opensubsystems.core.persist.db.DatabaseFactoryImpl
getConcurrencySelectListResultSet, getDataType, getTypeSelectListResultSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensubsystems.core.persist.DataFactory
getDataType
 

Field Detail

m_schema

protected BlogDatabaseSchema m_schema
Schema to use to execute database dependent operations.

Constructor Detail

EntryDatabaseFactory

public EntryDatabaseFactory()
                     throws org.opensubsystems.core.error.OSSException
Default constructor.

Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
Method Detail

setValuesForInsert

public int setValuesForInsert(java.sql.PreparedStatement insertStatement,
                              org.opensubsystems.core.data.DataObject data,
                              int iIndex)
                       throws org.opensubsystems.core.error.OSSException,
                              java.sql.SQLException

Specified by:
setValuesForInsert in interface org.opensubsystems.core.persist.db.BasicDatabaseFactory
Throws:
org.opensubsystems.core.error.OSSException
java.sql.SQLException

setValuesForUpdate

public int setValuesForUpdate(java.sql.PreparedStatement updateStatement,
                              org.opensubsystems.core.data.DataObject data,
                              int iIndex)
                       throws org.opensubsystems.core.error.OSSException,
                              java.sql.SQLException

Specified by:
setValuesForUpdate in interface org.opensubsystems.core.persist.db.ModifiableDatabaseFactory
Throws:
org.opensubsystems.core.error.OSSException
java.sql.SQLException

load

public org.opensubsystems.core.data.DataObject load(java.sql.ResultSet rsQueryResults,
                                                    int initialIndex)
                                             throws org.opensubsystems.core.error.OSSDatabaseAccessException

Specified by:
load in interface org.opensubsystems.core.persist.db.DatabaseFactory
Throws:
org.opensubsystems.core.error.OSSDatabaseAccessException

get

public org.opensubsystems.core.data.DataObject get(int iId,
                                                   int iDomainId)
                                            throws org.opensubsystems.core.error.OSSException

Specified by:
get in interface org.opensubsystems.core.persist.DataFactory
Throws:
org.opensubsystems.core.error.OSSException

create

public org.opensubsystems.core.data.DataObject create(org.opensubsystems.core.data.DataObject data)
                                               throws org.opensubsystems.core.error.OSSException

Specified by:
create in interface org.opensubsystems.core.persist.BasicDataFactory
Throws:
org.opensubsystems.core.error.OSSException

create

public int create(java.util.Collection colDataObject)
           throws org.opensubsystems.core.error.OSSException

Specified by:
create in interface org.opensubsystems.core.persist.BasicDataFactory
Throws:
org.opensubsystems.core.error.OSSException

delete

public void delete(int iId,
                   int iDomainId)
            throws org.opensubsystems.core.error.OSSException

Specified by:
delete in interface org.opensubsystems.core.persist.BasicDataFactory
Throws:
org.opensubsystems.core.error.OSSException

save

public org.opensubsystems.core.data.ModifiableDataObject save(org.opensubsystems.core.data.ModifiableDataObject data)
                                                       throws org.opensubsystems.core.error.OSSException

Specified by:
save in interface org.opensubsystems.core.persist.ModifiableDataFactory
Throws:
org.opensubsystems.core.error.OSSException

getAll

public java.util.List getAll(int iBlogId)
                      throws org.opensubsystems.core.error.OSSException
Get all entries from blog

Specified by:
getAll in interface EntryFactory
Parameters:
iBlogId - - ID of the blog to get entry from
Returns:
List - list of entries sorted from the most recent to the oldest one or null if none exists
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getLast

public Entry getLast(int iBlogId)
              throws org.opensubsystems.core.error.OSSException
Get last added entry added to the specified blog

Specified by:
getLast in interface EntryFactory
Parameters:
iBlogId - - id of the blog to get entry from
Returns:
Entry - last added entry or null if no entry couldn't be found
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured


Copyright © 2003 - 2007 OpenSubsystems s.r.o.