net.sqlind
Class SQLQueryMapper

java.lang.Object
  extended by net.sqlind.SQLQueryMapper

public class SQLQueryMapper
extends Object

SQLind

Since:
2011
Author:
Rives Davy.

Nested Class Summary
 class SQLQueryMapper.InjectPoint
          Structure class to define an insert point in a query
static interface SQLQueryMapper.QueryBehavior
          Generic query result fetching interface
static interface SQLQueryMapper.SQLBeanAccess
           
 class SQLQueryMapper.SQLMapperException
          Generic exception throws by the API.
 class SQLQueryMapper.SQLQueryHandler
          Handle a query execution context
static interface SQLQueryMapper.SQLQueryTemplate
          Represents a SQL template definition
 
Constructor Summary
protected SQLQueryMapper()
           
 
Method Summary
 void clearCache()
          Remove all entries from the LRU cache
static SQLQueryMapper getInstance()
           
 SQLQueryMapper.SQLQueryHandler getSQLQuery(String file, String schema, String id, String... params)
          Retrieve a given query for a template context (schema, parameters...)
 void setCacheSize(int numberOfQuery)
          Defines the LRU policy cache size
protected static String shrinkSQL(String queryStr, List<SQLQueryMapper.InjectPoint> ips)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLQueryMapper

protected SQLQueryMapper()
Method Detail

setCacheSize

public void setCacheSize(int numberOfQuery)
Defines the LRU policy cache size

Parameters:
numberOfQuery -

clearCache

public void clearCache()
Remove all entries from the LRU cache


getInstance

public static SQLQueryMapper getInstance()
Returns:
the singleton manager instance of SQLQueryMapper

shrinkSQL

protected static String shrinkSQL(String queryStr,
                                  List<SQLQueryMapper.InjectPoint> ips)

getSQLQuery

public SQLQueryMapper.SQLQueryHandler getSQLQuery(String file,
                                                  String schema,
                                                  String id,
                                                  String... params)
                                           throws SQLQueryMapper.SQLMapperException
Retrieve a given query for a template context (schema, parameters...)

Parameters:
file - the template file
schemathe - DB schema name
id - the query id
params - optional sections id to enable
Returns:
SQLQuery object
Throws:
SQLQueryMapper.SQLMapperException


Copyright © 2011. All Rights Reserved.