|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.edg.data.util.attribute.SQLHelpers
This abstracts out the concept of a 1-N guid -> entry mapping in a catalog.
It is used in both the LRC and RMC with the entry
being the
pfn
and alias
respectively.
It is configured by supplying different SQLCatalog
instances, which
contain the actual SQL that is relevant to the tables in the database.
Constructor Summary | |
SQLHelpers(java.lang.String catalog,
java.lang.String vendor)
|
Method Summary | |
boolean |
addEntry(java.sql.Connection conn,
java.lang.String guid,
java.lang.String entry)
Add a entry for a guid. |
int |
countStarFromTable(java.sql.Connection conn,
java.lang.String tableName)
|
java.util.List |
entriesForGuid(java.sql.Connection conn,
java.lang.String guid)
get the list of entries for a guid. |
boolean |
entryExists(java.sql.Connection conn,
java.lang.String entry)
does a entry exist in the db ? |
java.lang.String |
getSchemaVersion(java.sql.Connection conn)
Get the schema version from the catalog. |
boolean |
guidExists(java.sql.Connection conn,
java.lang.String guid)
does a guid exist in the db ? |
java.lang.String |
guidForEntry(java.sql.Connection conn,
java.lang.String entry)
Gets the guid that an entry is mapped to. returns null if the
entry does not exist |
void |
removeEntryFromGuid(java.sql.Connection conn,
java.lang.String guid,
java.lang.String entry)
remove an entry from the entry table in the rmc. |
void |
removeGuidIfEmpty(java.sql.Connection conn,
java.lang.String guid)
Remove a guid from the guid table if it has no entries mapped to it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SQLHelpers(java.lang.String catalog, java.lang.String vendor) throws InvalidCatalogException
Method Detail |
public boolean guidExists(java.sql.Connection conn, java.lang.String guid) throws java.sql.SQLException
java.sql.SQLException
public boolean entryExists(java.sql.Connection conn, java.lang.String entry) throws java.sql.SQLException
java.sql.SQLException
public boolean addEntry(java.sql.Connection conn, java.lang.String guid, java.lang.String entry) throws java.sql.SQLException
conn
- the connectionguid
- the guidentry
- the entry
true
if the entry was not there already.
java.sql.SQLException
public void removeEntryFromGuid(java.sql.Connection conn, java.lang.String guid, java.lang.String entry) throws java.sql.SQLException
conn
- the catalogentry
- the entry to remove
java.sql.SQLException
public void removeGuidIfEmpty(java.sql.Connection conn, java.lang.String guid) throws java.sql.SQLException
conn
- the catalogguid
- the guid to remove
java.sql.SQLException
public java.util.List entriesForGuid(java.sql.Connection conn, java.lang.String guid) throws java.sql.SQLException
conn
- the connectionguid
- the guid
java.sql.SQLException
public java.lang.String guidForEntry(java.sql.Connection conn, java.lang.String entry) throws java.sql.SQLException
null
if the
entry does not exist
conn
- the connection to the Catalogentry
- the entry to get the guid for
java.sql.SQLException
public int countStarFromTable(java.sql.Connection conn, java.lang.String tableName) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getSchemaVersion(java.sql.Connection conn) throws java.sql.SQLException
undefined
if the appropriate table (schema_version) does
not exist in the catalog, or if it contains no value.
conn
- the database connection to use
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |