com.jenkov.mrpersister.impl.mapping
Class HsqldbPrimaryKeyDeterminer

java.lang.Object
  extended by com.jenkov.mrpersister.impl.mapping.HsqldbPrimaryKeyDeterminer
All Implemented Interfaces:
IDbPrimaryKeyDeterminer

public class HsqldbPrimaryKeyDeterminer
extends java.lang.Object
implements IDbPrimaryKeyDeterminer

Author:
Jakob Jenkov - Copyright 2005 Jenkov Development

Constructor Summary
HsqldbPrimaryKeyDeterminer()
           
 
Method Summary
 java.lang.String getPrimaryKeyColumnName(java.lang.String table, java.lang.String databaseName, java.sql.Connection connection)
          Returns the primary key column name for the given table and database.
 IKey getPrimaryKeyMapping(java.lang.String table, java.lang.String databaseName, java.sql.Connection connection)
          Returns a list of the columns that are part of the
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HsqldbPrimaryKeyDeterminer

public HsqldbPrimaryKeyDeterminer()
Method Detail

getPrimaryKeyColumnName

public java.lang.String getPrimaryKeyColumnName(java.lang.String table,
                                                java.lang.String databaseName,
                                                java.sql.Connection connection)
                                         throws PersistenceException
Description copied from interface: IDbPrimaryKeyDeterminer
Returns the primary key column name for the given table and database. The database name is optional as this name is usually implicitly referenced in the database connection. You can leave it to null in most cases (in fact you should only need to set this if referencing a database other than the one connected to. A different database on the same server that is, not a different database server).

Specified by:
getPrimaryKeyColumnName in interface IDbPrimaryKeyDeterminer
Parameters:
table - The name of the table to determine the primary key column name of.
databaseName - The name of the database. Set this to null in most cases. See above description.
connection - The connection to the database in which the table exists to determine primary key column for.
Returns:
The name of the primary key column of the given table. Null if the table has no primary key.
Throws:
PersistenceException - If anything goes wrong during primary key column name determining.

getPrimaryKeyMapping

public IKey getPrimaryKeyMapping(java.lang.String table,
                                 java.lang.String databaseName,
                                 java.sql.Connection connection)
                          throws PersistenceException
Description copied from interface: IDbPrimaryKeyDeterminer
Returns a list of the columns that are part of the

Specified by:
getPrimaryKeyMapping in interface IDbPrimaryKeyDeterminer
Returns:
Throws:
PersistenceException