ua.gradsoft.xwikisql
Class SqlPluginConfiguration

java.lang.Object
  extended by ua.gradsoft.xwikisql.SqlPluginConfiguration
All Implemented Interfaces:
java.io.Serializable

public class SqlPluginConfiguration
extends java.lang.Object
implements java.io.Serializable

Object, which holds configuration information. Can be readed/stored from JaxB XML.

Author:
rssh
See Also:
Serialized Form

Constructor Summary
SqlPluginConfiguration()
           
 
Method Summary
 java.lang.String getInitialContextPrefix()
          get initialContextPrefix property.
 boolean getLogEnabled()
          when property is enabled (by default) do logging according with settings of xwiki log system.
 boolean getLogSql()
          when property is enabled, log executed sql statements.
 int getMaxRowsRetrieved()
          get maximum number of rows, which can be retrieved in one sql query.
 boolean getNullAsEmptyString()
          when property is enabled, SqlResultRow.getString(String columnName) and SqlResultRow.getString(int columnIndex) methods return empty string instead null, when appropriative column value is null.
 boolean getThrowExceptions()
          get policy of error handling.
 void setInitalContextPrefix(java.lang.String value)
          set initialContextPrefix property to value value
 void setLogEnabled(boolean value)
          set logEnabled property
 void setLogSql(boolean value)
          set logSql property
 void setMaxRowsRetrieved(int value)
           
 void setNullAsEmptyString(boolean value)
          set nullAsEmptyString property to value value
 void setThrowExceptions(boolean value)
          set throwExceptions property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlPluginConfiguration

public SqlPluginConfiguration()
Method Detail

getMaxRowsRetrieved

public int getMaxRowsRetrieved()
get maximum number of rows, which can be retrieved in one sql query.

See Also:
SqlDatabase.executeQuery(java.lang.String,java.util.List)

setMaxRowsRetrieved

public void setMaxRowsRetrieved(int value)
See Also:
getMaxRowsRetrieved()

getThrowExceptions

public boolean getThrowExceptions()
get policy of error handling. When this property is set to true, than behaviour of library on error is immediatly throw appropriative exception. When false -- than library call return some special value (usially null) and set fields in associated SqlErrorable object.

See Also:
SqlErrorable

setThrowExceptions

public void setThrowExceptions(boolean value)
set throwExceptions property

See Also:
getThrowExceptions()

getLogSql

public boolean getLogSql()
when property is enabled, log executed sql statements.


setLogSql

public void setLogSql(boolean value)
set logSql property

See Also:
getLogSql()

getNullAsEmptyString

public boolean getNullAsEmptyString()
when property is enabled, SqlResultRow.getString(String columnName) and SqlResultRow.getString(int columnIndex) methods return empty string instead null, when appropriative column value is null.

See Also:
SqlResultRow.getString(String), SqlResultRow.getString(int)

setNullAsEmptyString

public void setNullAsEmptyString(boolean value)
set nullAsEmptyString property to value value

See Also:
getNullAsEmptyString()

getInitialContextPrefix

public java.lang.String getInitialContextPrefix()
get initialContextPrefix property. This is prefix of JNDI initial context, where we search name of datasource. Default -- java:comp/env , can be changed by appropriateve setter of configurable variable xwikisql.initialContextPrefix

See Also:
SqlPluginApi.getDatabase(java.lang.String)

setInitalContextPrefix

public void setInitalContextPrefix(java.lang.String value)
set initialContextPrefix property to value value

See Also:
getInitialContextPrefix()

getLogEnabled

public boolean getLogEnabled()
when property is enabled (by default) do logging according with settings of xwiki log system.


setLogEnabled

public void setLogEnabled(boolean value)
set logEnabled property

See Also:
getLogEnabled()