Package org.apache.openjpa.jdbc.sql
Class DBDictionaryFactory
- java.lang.Object
-
- org.apache.openjpa.jdbc.sql.DBDictionaryFactory
-
public class DBDictionaryFactory extends java.lang.Object
Factory class to instantiate a dictionary. It will use the following heuristic:- Check to see if there is a DictionaryClass property, and if so, use that to instantiate the dictionary.
- Check the URL in the JDBCConfiguration against a list of pre-defined URLs for various dictionaries.
- Check the driver in the JDBCConfiguration against a list of known patterns.
- Acquire a connection and check its database metadata.
- Return an instance of the generic DBDictionary.
- Author:
- Marc Prud'hommeaux
-
-
Constructor Summary
Constructors Constructor Description DBDictionaryFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DBDictionary
calculateDBDictionary(JDBCConfiguration conf, java.lang.String url, java.lang.String driver, java.lang.String props)
Attempt to create the dictionary from the given connection URL and driver name, either or both of which may be null.static DBDictionary
newDBDictionary(JDBCConfiguration conf, java.lang.String dclass, java.lang.String props)
Create the dictionary for the given class name and properties.static DBDictionary
newDBDictionary(JDBCConfiguration conf, javax.sql.DataSource ds, java.lang.String props)
Create the dictionary using connection metadata to determine its type.static java.lang.String
toString(java.sql.DatabaseMetaData meta)
Return a string containing all the property values of the given database metadata.
-
-
-
Method Detail
-
newDBDictionary
public static DBDictionary newDBDictionary(JDBCConfiguration conf, java.lang.String dclass, java.lang.String props)
Create the dictionary for the given class name and properties.
-
calculateDBDictionary
public static DBDictionary calculateDBDictionary(JDBCConfiguration conf, java.lang.String url, java.lang.String driver, java.lang.String props)
Attempt to create the dictionary from the given connection URL and driver name, either or both of which may be null. If the dictionary cannot be calculated, returns null.
-
newDBDictionary
public static DBDictionary newDBDictionary(JDBCConfiguration conf, javax.sql.DataSource ds, java.lang.String props)
Create the dictionary using connection metadata to determine its type.
-
toString
public static java.lang.String toString(java.sql.DatabaseMetaData meta) throws java.sql.SQLException
Return a string containing all the property values of the given database metadata.- Throws:
java.sql.SQLException
-
-