nl.gx.webmanager.services.seo.dao.impl
Class DBPageFriendlyURLEntityDAOImpl

java.lang.Object
  extended by nl.gx.webmanager.services.seo.dao.impl.FriendlyURLEntityDAOImpl
      extended by nl.gx.webmanager.services.seo.dao.impl.DBPageFriendlyURLEntityDAOImpl
All Implemented Interfaces:
DBPageFriendlyURLEntityDAO, FriendlyURLEntityDAO

public final class DBPageFriendlyURLEntityDAOImpl
extends FriendlyURLEntityDAOImpl
implements DBPageFriendlyURLEntityDAO

Data access methods specific for friendly URLs of database pages.

Author:
Sander Dahlberg

Constructor Summary
DBPageFriendlyURLEntityDAOImpl(SEODatabaseUtil seoDatabaseUtil)
          Constructor.
 
Method Summary
protected  java.util.List<java.lang.Object> getAvailabilityArguments(FriendlyURLEntity entity)
          Returns the SQL arguments for checking the availability of a friendly URL.
protected  java.lang.String getAvailabilityQuery()
          Returns SQL query that confirms a given friendly URL is unique.
protected  java.lang.String getDeleteQuery()
          Returns SQL delete query used for deleting friendly URLs.
 FriendlyURLEntity getEntity(int versionId)
          Returns a friendly URL entity given its version ID.
 FriendlyURLEntity getEntity(int dbId, int typeOfPageId)
          Returns a friendly URL entity specific for database pages.
protected  java.util.List<java.lang.Object> getInsertArguments(FriendlyURLEntity entity)
          Returns the SQL arguments for the insertion of the given friendly URL entity.
protected  java.lang.String getInsertQuery()
          Returns SQL insert query used for creating friendly URLs.
protected  java.lang.String getMatchQuery()
          Returns SQL query that returns a matching friendly URL.
protected  java.lang.String getMatchQueryNullSequence()
          Returns SQL query that returns a matching friendly URL.
protected  java.lang.String getReferringQuery()
          Returns SQL select query used for returning referring friendly URLs.
protected  java.lang.String getSelectByIdQuery()
          Returns SQL select query for retrieving friendly URL by id.
protected  boolean identifierConflictsWithInMemEntities(FriendlyURLEntity sourceEntity, java.util.List<FriendlyURLEntity> targetEntities)
          Checks whether the source entity is in conflict with one of the target entities.
protected  java.util.List<FriendlyURLEntity> selectFriendlyURLs(java.lang.String query, java.util.List<java.lang.Object> arguments)
          Selects friendly URL entities.
 
Methods inherited from class nl.gx.webmanager.services.seo.dao.impl.FriendlyURLEntityDAOImpl
activate, create, delete, deleteAll, deleteById, determineSequenceNumber, genericIdentifierConflicts, getCreateFields, getEntityById, getGenericInsertArguments, getReferencedEntity, getSelectFields, getSEODatabaseUtil, getSequenceNumber, getURLTitle, identifierConflicts, insertFriendlyURL, lastCurrent, makeIdentifierUnique, refer, refer, updateIdentifiers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.gx.webmanager.services.seo.dao.FriendlyURLEntityDAO
activate, create, delete, deleteAll, deleteById, getEntityById, getURLTitle, lastCurrent, makeIdentifierUnique, refer, refer, updateIdentifiers
 

Constructor Detail

DBPageFriendlyURLEntityDAOImpl

public DBPageFriendlyURLEntityDAOImpl(SEODatabaseUtil seoDatabaseUtil)
Constructor.

Parameters:
seoDatabaseUtil - Reference to the SEO database util class.
Method Detail

getEntity

public FriendlyURLEntity getEntity(int versionId)
                            throws FriendlyURLException
Returns a friendly URL entity given its version ID.

Specified by:
getEntity in interface FriendlyURLEntityDAO
Specified by:
getEntity in class FriendlyURLEntityDAOImpl
Parameters:
versionId - The version identifier of the page or media item version for which its friendly URL entity is returned.
Returns:
Friendly URL entity object.
Throws:
FriendlyURLException - If any database access fails.

getEntity

public FriendlyURLEntity getEntity(int dbId,
                                   int typeOfPageId)
                            throws FriendlyURLException
Returns a friendly URL entity specific for database pages. An entity is specified by the identifiers of a database page.

Specified by:
getEntity in interface DBPageFriendlyURLEntityDAO
Parameters:
dbId - Specifies a specific entity of a database page type.
typeOfPageId - Specifies a database page type.
Returns:
Database page friendly URL entity object.
Throws:
FriendlyURLException - If any database access fails.

getSelectByIdQuery

protected java.lang.String getSelectByIdQuery()
Returns SQL select query for retrieving friendly URL by id.

Specified by:
getSelectByIdQuery in class FriendlyURLEntityDAOImpl
Returns:
SQL select query.

getInsertQuery

protected java.lang.String getInsertQuery()
Returns SQL insert query used for creating friendly URLs.

Specified by:
getInsertQuery in class FriendlyURLEntityDAOImpl
Returns:
SQL insert query.

getInsertArguments

protected java.util.List<java.lang.Object> getInsertArguments(FriendlyURLEntity entity)
Returns the SQL arguments for the insertion of the given friendly URL entity.

Specified by:
getInsertArguments in class FriendlyURLEntityDAOImpl
Parameters:
entity - Friendly URL entity to return its arguments for.
Returns:
Array of arguments for the insert query.

getAvailabilityArguments

protected java.util.List<java.lang.Object> getAvailabilityArguments(FriendlyURLEntity entity)
Returns the SQL arguments for checking the availability of a friendly URL.

Specified by:
getAvailabilityArguments in class FriendlyURLEntityDAOImpl
Parameters:
entity - Friendly URL entity to return its arguments for.
Returns:
Array of arguments for the availability query.

getAvailabilityQuery

protected java.lang.String getAvailabilityQuery()
Returns SQL query that confirms a given friendly URL is unique.

Specified by:
getAvailabilityQuery in class FriendlyURLEntityDAOImpl
Returns:
SQL query for confirming uniqueness.

getMatchQuery

protected java.lang.String getMatchQuery()
Returns SQL query that returns a matching friendly URL. Used by FriendlyURLEntityDAOImpl.findMatchFromHistory(FriendlyURLEntity).

Specified by:
getMatchQuery in class FriendlyURLEntityDAOImpl
Returns:
SQL query for finding a matching friendly URL.

getMatchQueryNullSequence

protected java.lang.String getMatchQueryNullSequence()
Returns SQL query that returns a matching friendly URL. Used by FriendlyURLEntityDAOImpl.findMatchFromHistory(FriendlyURLEntity). Difference with FriendlyURLEntityDAOImpl.getMatchQuery() is that the sequence is checked for being null.

Specified by:
getMatchQueryNullSequence in class FriendlyURLEntityDAOImpl
Returns:
SQL query for finding a matching friendly URL.

identifierConflictsWithInMemEntities

protected boolean identifierConflictsWithInMemEntities(FriendlyURLEntity sourceEntity,
                                                       java.util.List<FriendlyURLEntity> targetEntities)
Checks whether the source entity is in conflict with one of the target entities.

Specified by:
identifierConflictsWithInMemEntities in class FriendlyURLEntityDAOImpl
Parameters:
sourceEntity - Source friendly URL entity.
targetEntities - Target friendly URL entities.
Returns:
true if URL identifier is not unique, false otherwise.

getDeleteQuery

protected java.lang.String getDeleteQuery()
Returns SQL delete query used for deleting friendly URLs.

Specified by:
getDeleteQuery in class FriendlyURLEntityDAOImpl
Returns:
SQL delete query.

getReferringQuery

protected java.lang.String getReferringQuery()
Returns SQL select query used for returning referring friendly URLs.

Specified by:
getReferringQuery in class FriendlyURLEntityDAOImpl
Returns:
SQL select query.

selectFriendlyURLs

protected java.util.List<FriendlyURLEntity> selectFriendlyURLs(java.lang.String query,
                                                               java.util.List<java.lang.Object> arguments)
                                                        throws java.sql.SQLException
Selects friendly URL entities. The type of entities in the returned list reflects the type of the implementing class.

Specified by:
selectFriendlyURLs in class FriendlyURLEntityDAOImpl
Parameters:
query - Execute this select query, which must retrieve all friendly URL select fields.
arguments - The arguments for the given query.
Returns:
Array of friendly URL entities.
Throws:
java.sql.SQLException - If a database access error occurs.


Copyright © 2007-2010 GX creative online development BV. All Rights Reserved.