org.opensubsystems.blog.persist.db.mysql
Class MySQLBlogDatabaseSchema

java.lang.Object
  extended by org.opensubsystems.core.persist.db.DatabaseSchemaImpl
      extended by org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
          extended by org.opensubsystems.blog.persist.db.BlogDatabaseSchema
              extended by org.opensubsystems.blog.persist.db.mysql.MySQLBlogDatabaseSchema
All Implemented Interfaces:
org.opensubsystems.core.persist.db.DatabaseOperations, org.opensubsystems.core.persist.db.DatabaseSchema, org.opensubsystems.core.persist.db.ModifiableDatabaseSchema

public class MySQLBlogDatabaseSchema
extends BlogDatabaseSchema

Database specific operations related to persistence of blogs and their entries. This class encapsulate functionality specific for MySQL.

Version:
$Id: MySQLBlogDatabaseSchema.java,v 1.7 2007/01/07 06:04:34 bastafidli Exp $
Author:
Julian Legeny
Code reviewer:
Miro Halas
Code reviewed:
1.2 2006/07/13 23:44:36 jlegeny

Field Summary
 
Fields inherited from class org.opensubsystems.blog.persist.db.BlogDatabaseSchema
BLOG_CAPTION_MAXLENGTH, BLOG_COLUMNS, BLOG_COMMENTS_MAXLENGTH, BLOG_FOLDER_MAXLENGTH, BLOG_SCHEMA_NAME, BLOG_SCHEMA_VERSION, BLOG_TABLE_NAME, BLOGENTRY_CAPTION_MAXLENGTH, BLOGENTRY_COMMENTS_MAXLENGTH, BLOGENTRY_IMAGEURL_MAXLENGTH, BLOGENTRY_TABLE_NAME, BLOGENTRY_TARGETURL_MAXLENGTH, ENTRY_COLUMNS, TABLE_NAMES
 
Fields inherited from class org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
m_mapModifiableTableNames
 
Fields inherited from class org.opensubsystems.core.persist.db.DatabaseSchemaImpl
DATABASE_SCHEMA_PREFIX, DATABASE_SCHEMA_PREFIX_DEFAULT, m_arrDependentSchemas, m_bIsInDomain, m_iSchemaVersion, m_strSchemaName, NL
 
Fields inherited from interface org.opensubsystems.core.persist.db.DatabaseOperations
DBOP_DELETE, DBOP_INSERT, DBOP_SELECT, DBOP_UPDATE
 
Constructor Summary
MySQLBlogDatabaseSchema()
          Default constructor.
 
Method Summary
 void create(java.sql.Connection cntDBConnection, java.lang.String strUserName)
          
 java.lang.String getInsertBlog()
          Method returns simple insert blog query.
 java.lang.String getInsertBlogAndFetchGeneratedValues()
          Get query that inserts a blog to the database and fetches database generated values such as the generated id and creation timestamp
 java.lang.String getInsertEntry()
          Method returns simple insert entry query.
 java.lang.String getInsertEntryAndFetchGeneratedValues()
          Get query that inserts a entry to the database and fetches database generated values such as the generated id and creation timestamp
 java.lang.String getUpdateBlogAndFetchGeneratedValues()
          Get query that updates blog in the database and fetches database generated values such as the updated modification timestamp
 java.lang.String getUpdateEntryAndFetchGeneratedValues()
          Get query that updates entry in the database and fetches database generated values such as the updated modification timestamp
 
Methods inherited from class org.opensubsystems.blog.persist.db.BlogDatabaseSchema
getDeleteBlogById, getDeleteEntryById, getSelectAllBlogs, getSelectAllEntries, getSelectBlogByFolder, getSelectBlogById, getSelectEntryById, getSelectLastEntry, handleSQLException
 
Methods inherited from class org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
deleteRelatedData, getModifiableTableNames
 
Methods inherited from class org.opensubsystems.core.persist.db.DatabaseSchemaImpl
getDependentSchemas, getJoinFromWhere, getName, getOwnerColumnNames, getSchemaPrefix, getVersion, isExistingIndex, isInDomain, upgrade, upgradeView
 
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.db.DatabaseSchema
getDependentSchemas, getName, getVersion, isInDomain, upgrade
 

Constructor Detail

MySQLBlogDatabaseSchema

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

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

create

public void create(java.sql.Connection cntDBConnection,
                   java.lang.String strUserName)
            throws java.sql.SQLException

Throws:
java.sql.SQLException

getInsertBlogAndFetchGeneratedValues

public java.lang.String getInsertBlogAndFetchGeneratedValues()
                                                      throws org.opensubsystems.core.error.OSSException
Get query that inserts a blog to the database and fetches database generated values such as the generated id and creation timestamp

Specified by:
getInsertBlogAndFetchGeneratedValues in class BlogDatabaseSchema
Returns:
String - query for simple insert or stored procedure call
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getUpdateBlogAndFetchGeneratedValues

public java.lang.String getUpdateBlogAndFetchGeneratedValues()
                                                      throws org.opensubsystems.core.error.OSSException
Get query that updates blog in the database and fetches database generated values such as the updated modification timestamp

Specified by:
getUpdateBlogAndFetchGeneratedValues in class BlogDatabaseSchema
Returns:
String - query for simple update or stored procedure call
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getInsertBlog

public java.lang.String getInsertBlog()
                               throws org.opensubsystems.core.error.OSSException
Method returns simple insert blog query. This method is common for all databases and can be overwritten for each specific database schema.

Overrides:
getInsertBlog in class BlogDatabaseSchema
Returns:
String - simple insert blog query
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getInsertEntry

public java.lang.String getInsertEntry()
                                throws org.opensubsystems.core.error.OSSException
Method returns simple insert entry query. This method is common for all databases and can be overwritten for each specific database schema.

Overrides:
getInsertEntry in class BlogDatabaseSchema
Returns:
String - simple insert entry query
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getInsertEntryAndFetchGeneratedValues

public java.lang.String getInsertEntryAndFetchGeneratedValues()
                                                       throws org.opensubsystems.core.error.OSSException
Get query that inserts a entry to the database and fetches database generated values such as the generated id and creation timestamp

Specified by:
getInsertEntryAndFetchGeneratedValues in class BlogDatabaseSchema
Returns:
String - query for simple insert or stored procedure call
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getUpdateEntryAndFetchGeneratedValues

public java.lang.String getUpdateEntryAndFetchGeneratedValues()
                                                       throws org.opensubsystems.core.error.OSSException
Get query that updates entry in the database and fetches database generated values such as the updated modification timestamp

Specified by:
getUpdateEntryAndFetchGeneratedValues in class BlogDatabaseSchema
Returns:
String - query for simple update or stored procedure call
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured


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