|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.arcsde.data.ViewRegisteringFactoryHelper
public class ViewRegisteringFactoryHelper
Utility class to help DataStoreFactories for org.geotools.data.sql.SqlDataStores
register the views provided in a java.util.Map
in the call to the factory's
createDataStore(Map)
method.
NOTE this class is a rough copy of the one in the sql-datastore unsupported module. We are incorporating it here as don't want to depend on sql-datastore. Thus, it's expected to be replaced by the original once we work out what to do with the sql-datastore module.
Due to the non hierarchical nature of a Map, it is no so easy to provide a variable number of arguments on it for the same keyword, since they're usually read from a .properties file.
This class helps to minimize the work needed to provide such a mapping of various SQL views to an in-process feature type by defining the following structure for a Map<String,String> passed to createDataStore. Example .properties file:
<code> dbtype=... <usual datastore's parameters>... sqlView.1.typeName = ViewType1 sqlView.1.sqlQuery = select gid, the_geom, table2.someField \ from table1, table2 \ where table1.gid = table2.table1_id sqlView.2.typeName = ViewType2 sqlView.2.sqlQuery = select ... </code>This way, this class' utility method #registerSqlViews(SqlDataStore, Map) will receive a org.geotools.data.sql.SqlDataStore and the Map of datastore factory parameters and call org.geotools.data.sql.SqlDataStore#registerView(String, String) for each pair of
sqlView.N.typeName, sqlView.N.sqlQuery
Method Summary | |
---|---|
static java.util.Map |
cleanUpViewDefinitions(java.util.Map params)
Looks up the set of "sqlView.N.typeName" and "sqlView.N.sqlQuery" keys in params
and returns a cleaned up map of typeName/query. |
static net.sf.jsqlparser.statement.select.PlainSelect |
parseSqlQuery(java.lang.String selectStatement)
|
static void |
registerSqlViews(ArcSDEDataStore dataStore,
java.util.Map params)
Registers the sql views provided in params on the SqlDataStore
dataStore |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void registerSqlViews(ArcSDEDataStore dataStore, java.util.Map params) throws java.io.IOException
params
on the SqlDataStore
dataStore
dataStore
- params
-
java.io.IOException
public static java.util.Map cleanUpViewDefinitions(java.util.Map params)
params
and returns a cleaned up map of typeName/query.
params
-
public static net.sf.jsqlparser.statement.select.PlainSelect parseSqlQuery(java.lang.String selectStatement) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |