org.ujorm.orm.metaModel
Class MetaParams

java.lang.Object
  extended by org.ujorm.extensions.SuperAbstractUjo
      extended by org.ujorm.extensions.AbstractUjo
          extended by org.ujorm.orm.AbstractMetaModel
              extended by org.ujorm.orm.metaModel.MetaParams
All Implemented Interfaces:
Serializable, UjoCloneable, UjoLockable, UjoTextable, Ujo

public final class MetaParams
extends AbstractMetaModel

A logical database description. The class is a root of database configuration.

See Also:
Serialized Form

Field Summary
static Key<MetaParams,Object> APPL_CONTEXT
          An application context for initializaton of the customer componets of the meta-model.
static Key<MetaParams,CachePolicy> CACHE_POLICY
          Session cache policy.
static Key<MetaParams,CheckReport> CHECK_KEYWORDS
          CheckReport a keyword in the database table or colum name inside the meta-model.
static Key<MetaParams,CommentPolicy> COMMENT_POLICY
          A policy for assigning an annotation table comment Comment to database.
static Key<MetaParams,Boolean> INHERITANCE_MODE
          Any action type or CREATE, UPDATE, DELETE on inheritance objects calls the same action to its 'parent' object.
static Key<MetaParams,Class<? extends InitializationBatch>> INITIALIZATION_BATCH
          An inicializaton batch implementation can be called after building the ORM meta-model.
static Key<MetaParams,Integer> INSERT_MULTIROW_ITEM_LIMIT
          The parameter is used to limit of the insert sttatemtn in case the "sql multirow insert".
static Key<MetaParams,LazyLoading> LAZY_LOADING
          The parameter 'lazyLoading' specify a lazy-loading policy in case that UJO objects have got any sesson.
static Key<MetaParams,Boolean> LOG_METAMODEL_INFO
          Set a logging level for a full meta-model information in the XML format where the default parameter value is true.
static Key<MetaParams,Boolean> LOG_SQL_MULTI_INSERT
          Enable the loggin for a multi-value SQL statement INSERT including its values where the default parameter value is false.
static Key<MetaParams,Integer> LOG_VALUE_LENGTH_LIMIT
          Logging JDBC arguments can be cropped using the next argument, default value 128 characters per value, the value Integer.MAX_VALUE means an unlimited.
static Key<MetaParams,Boolean> LOGBACK_LOGGING_SUPPORT
          Pamameter tries to install a brighe to the Logback logging framework using a statement SLF4JBridgeHandler.install();
static Key<MetaParams,Integer> MAX_ITEM_COUNT_4_IN
          The maximal count of items for the SQL IN operator, default value is 500 items The limit is used inside the method loadLazyValuesAsBatch(..).
static Key<MetaParams,Class<? extends MetaDbService>> META_DB_SERVICE
          The instance of the parameter class MetaDbService is used for creating and validaton a database according to the meta-model.
static Key<MetaParams,MoreParams> MORE_PARAMS
          The parameter contains the special parameters with for different use.
static Key<MetaParams,Orm2ddlPolicy> ORM2DLL_POLICY
          A policy to defining the database structure by a DDL.
static Key<MetaParams,File> SAVE_CONFIG_TO_FILE
          Framework can save the final configuration file to a new file for an external use.
static Key<MetaParams,Integer> SEQUENCE_CACHE
          Sequential cache parameter saves the number of requests to the following sequence when a insert statement into DB.
static Key<MetaParams,Boolean> SEQUENCE_SCHEMA_SYMBOL
          The parameter value TRUE affects to a Sequence key name in the internal sequence generator.
static Key<MetaParams,Class<? extends SqlNameProvider>> SQL_NAME_PROVIDER
          Default SQL name provider for special names of database is called: SqlNameProvider
static Key<MetaParams,String> TABLE_ALIAS_PREFIX
          Special prameter for an automatically assembled table alias prefix.
static Key<MetaParams,String> TABLE_ALIAS_SUFFIX
          Special prameter for an automatically assembled table alias prefix.
static Key<MetaParams,Class<? extends ITypeService>> TYPE_SERVICE
          The instance of the parameter class ITypeService is used for conversion, reading and writting to/from the ResultSet.
 
Constructor Summary
MetaParams()
           
 
Method Summary
<T extends ITypeService>
T
getConverter(Class<T> converterClass)
          Returns a converter instance.
 InitializationBatch getInitializationBatch()
          Retunrs an instance of the initialization batch
 boolean isQuotedSqlNames()
          Skip the check test and Quote all SQL columns, tables and alias names.
 MoreParams more()
          Returns an object to provide the special parameters for a different use.
 void set(Key<MetaParams,Class<? extends InitializationBatch>> key, InitializationBatch batch)
          Assign an initialization batch
<UJO extends MetaParams,VALUE>
MetaParams
set(Key<UJO,VALUE> key, VALUE value)
          Set a parameter value
 MetaParams setApplContext(Object applContext)
          Set application context.
 void setQuotedSqlNames(boolean quote)
          Skip the check test and Quote all SQL columns, tables and alias names.
 void writeValue(Key key, Object value)
          Write a value if the operation is enabled
 
Methods inherited from class org.ujorm.orm.AbstractMetaModel
changeDefault, checkReadOnly, clearReadOnly, get, lock, readAuthorization, readOnly, setReadOnly
 
Methods inherited from class org.ujorm.extensions.AbstractUjo
newCamelFactory, newFactory, readValue
 
Methods inherited from class org.ujorm.extensions.SuperAbstractUjo
clone, equals, init, init, readKeys, readUjoManager, readValueString, toString, writeValueString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ujorm.Ujo
readKeys, readValue
 

Field Detail

CACHE_POLICY

public static final Key<MetaParams,CachePolicy> CACHE_POLICY
Session cache policy. The default value is PROTECTED_CACHE.

See Also:
Parameter values

TABLE_ALIAS_PREFIX

public static final Key<MetaParams,String> TABLE_ALIAS_PREFIX
Special prameter for an automatically assembled table alias prefix. The default value is the empty string.


TABLE_ALIAS_SUFFIX

public static final Key<MetaParams,String> TABLE_ALIAS_SUFFIX
Special prameter for an automatically assembled table alias prefix. The default value is the empty String.


SEQUENCE_CACHE

public static final Key<MetaParams,Integer> SEQUENCE_CACHE
Sequential cache parameter saves the number of requests to the following sequence when a insert statement into DB. The value of the parameter is used only when creating a new DB, indivuální ORM changes for each table can be changed any time later in the column 'cache' of table 'ormujo_pk_support' . Default values is 100, the smallest possible value is 1.


LAZY_LOADING

public static final Key<MetaParams,LazyLoading> LAZY_LOADING
The parameter 'lazyLoading' specify a lazy-loading policy in case that UJO objects have got any sesson. Argument options are described in the enum LazyLoading. In case the object have assigned no session, the key returns the null value as well as common javabeans. A default key value is the LazyLoading.ALLOWED_USING_OPEN_SESSION.

See Also:
LazyLoading

ORM2DLL_POLICY

public static final Key<MetaParams,Orm2ddlPolicy> ORM2DLL_POLICY
A policy to defining the database structure by a DDL. The default value is option: CREATE_OR_UPDATE_DDL.

See Also:
Parameter values

COMMENT_POLICY

public static final Key<MetaParams,CommentPolicy> COMMENT_POLICY
A policy for assigning an annotation table comment Comment to database. The default value is ON_ANY_CHANGE.

See Also:
Parameter values

SAVE_CONFIG_TO_FILE

public static final Key<MetaParams,File> SAVE_CONFIG_TO_FILE
Framework can save the final configuration file to a new file for an external use. If this parameter is null than the save action is skipped.


INITIALIZATION_BATCH

public static final Key<MetaParams,Class<? extends InitializationBatch>> INITIALIZATION_BATCH
An inicializaton batch implementation can be called after building the ORM meta-model. Default value means: run no batch.

See Also:
InitializationBatch

TYPE_SERVICE

public static final Key<MetaParams,Class<? extends ITypeService>> TYPE_SERVICE
The instance of the parameter class ITypeService is used for conversion, reading and writting to/from the ResultSet. You can specify a sybtype of the class for a commiono special fetures.

See Also:
Column.converter()

META_DB_SERVICE

public static final Key<MetaParams,Class<? extends MetaDbService>> META_DB_SERVICE
The instance of the parameter class MetaDbService is used for creating and validaton a database according to the meta-model. You can overwrite some method for youre ieas.


SQL_NAME_PROVIDER

public static final Key<MetaParams,Class<? extends SqlNameProvider>> SQL_NAME_PROVIDER
Default SQL name provider for special names of database is called: SqlNameProvider


CHECK_KEYWORDS

public static final Key<MetaParams,CheckReport> CHECK_KEYWORDS
CheckReport a keyword in the database table or colum name inside the meta-model. The default value is EXCEPTION.

See Also:
Parameter values, #QUOTE_SQL_NAMES

MAX_ITEM_COUNT_4_IN

public static final Key<MetaParams,Integer> MAX_ITEM_COUNT_4_IN
The maximal count of items for the SQL IN operator, default value is 500 items The limit is used inside the method loadLazyValuesAsBatch(..).

See Also:
OrmTools.loadLazyValuesAsBatch(java.lang.Iterable, org.ujorm.Key)

SEQUENCE_SCHEMA_SYMBOL

public static final Key<MetaParams,Boolean> SEQUENCE_SCHEMA_SYMBOL
The parameter value TRUE affects to a Sequence key name in the internal sequence generator. Value TRUE generate a special character "~" instead of default database schema in the sequence table. The benefit of the special chatacter can be evaluated in the case of the renaming of the database schema. In case of change of the parameter value is necessary to convert values in the database column 'ujorm_pk_support.id' by hand.
NOTE: The default value is FALSE for backward compatibility, however for new projects is preferred value TRUE.


INHERITANCE_MODE

public static final Key<MetaParams,Boolean> INHERITANCE_MODE
Any action type or CREATE, UPDATE, DELETE on inheritance objects calls the same action to its 'parent' object. If the mode is off than you must take care of all its parents in the code handy. The default falue is TRUE.
Note: the parameter does not affect the opearations batch update or batch delete due direct modification of database.

See Also:
MetaTable.getParent(..)

INSERT_MULTIROW_ITEM_LIMIT

public static final Key<MetaParams,Integer> INSERT_MULTIROW_ITEM_LIMIT
The parameter is used to limit of the insert sttatemtn in case the "sql multirow insert". The default value is 100.

See Also:
save(List)

MORE_PARAMS

public static final Key<MetaParams,MoreParams> MORE_PARAMS
The parameter contains the special parameters with for different use.

See Also:
MoreParams

LOG_METAMODEL_INFO

public static final Key<MetaParams,Boolean> LOG_METAMODEL_INFO
Set a logging level for a full meta-model information in the XML format where the default parameter value is true. The TRUE value means the INFO level and the FALSE value means the FINE logging level.


LOG_SQL_MULTI_INSERT

public static final Key<MetaParams,Boolean> LOG_SQL_MULTI_INSERT
Enable the loggin for a multi-value SQL statement INSERT including its values where the default parameter value is false. If JDBC driver does not support the multi-value statement, the parameter is ignored.


LOGBACK_LOGGING_SUPPORT

public static final Key<MetaParams,Boolean> LOGBACK_LOGGING_SUPPORT
Pamameter tries to install a brighe to the Logback logging framework using a statement SLF4JBridgeHandler.install();


LOG_VALUE_LENGTH_LIMIT

public static final Key<MetaParams,Integer> LOG_VALUE_LENGTH_LIMIT
Logging JDBC arguments can be cropped using the next argument, default value 128 characters per value, the value Integer.MAX_VALUE means an unlimited.


APPL_CONTEXT

public static final Key<MetaParams,Object> APPL_CONTEXT
An application context for initializaton of the customer componets of the meta-model.

Constructor Detail

MetaParams

public MetaParams()
Method Detail

writeValue

public void writeValue(Key key,
                       Object value)
Description copied from class: AbstractMetaModel
Write a value if the operation is enabled

Specified by:
writeValue in interface UjoLockable
Specified by:
writeValue in interface Ujo
Overrides:
writeValue in class AbstractMetaModel

getConverter

public <T extends ITypeService> T getConverter(Class<T> converterClass)
Returns a converter instance. Method use an internal cache for smaller converter instance count.

Parameters:
converterClass - A class to create an instance of the converter. If the value is null, then a default converter defined in parameters is used.
Returns:
Returns a converter instance.

set

public <UJO extends MetaParams,VALUE> MetaParams set(Key<UJO,VALUE> key,
                                                     VALUE value)
Set a parameter value


setApplContext

public MetaParams setApplContext(Object applContext)
Set application context.


more

public MoreParams more()
Returns an object to provide the special parameters for a different use.


isQuotedSqlNames

public boolean isQuotedSqlNames()
Skip the check test and Quote all SQL columns, tables and alias names.
NOTE: The change of the parameter value affects the native SQL statements in Ujorm views.

See Also:
CHECK_KEYWORDS, CheckReport#SKIP_AND_QUOTE_SQL_NAMES

setQuotedSqlNames

public void setQuotedSqlNames(boolean quote)
Skip the check test and Quote all SQL columns, tables and alias names.
NOTE: The change of the parameter value affects the native SQL statements in Ujorm views.

Parameters:
quote - Parameter true affects to an escapinng the database names, else the false value will affects to checked a database KeyWords in the names.
See Also:
CHECK_KEYWORDS, CheckReport#SKIP_AND_QUOTE_SQL_NAMES

set

public void set(Key<MetaParams,Class<? extends InitializationBatch>> key,
                InitializationBatch batch)
Assign an initialization batch


getInitializationBatch

public InitializationBatch getInitializationBatch()
                                           throws IllegalStateException
Retunrs an instance of the initialization batch

Throws:
IllegalStateException


Copyright 2013, Pavel Ponec