Follow the links below to browse sample Javadoc for MJ classes and tools, including the MJ Runtime Library.
Interfaces and classes that facilitate and support generation of MJ's ETL (Extract, Transform and Load) artifacts.
Classes and Interfaces | |
DefaultDataEntityEtlGenerator | |
DefaultEtlGeneratorBase | |
IDataEntityEtlGenerator | Defines operations that generate ETL artifacts (e.g., scripts, data files) needed to load a data entity (database table) with lines of data from a Mapper report. |
IInlineDataEtlGenerator | |
ILineMetadataEtlGenerator | |
InsertSQL | Represents an SQL INSERT statement generated by Hibernate (or other means) and the place holders in the VALUES clause of the statement. |
InsertSQLPlaceholder | Represents a place holder (e.g., ?) |
PredefinedObjectFactory | Simple class for creating objects whose definition is always known but have utility when treated as other objects that are created dynamically. |
VetoOnPrepareException | Runtime exception thrown to act as veto of org.hibernate.Interceptor.onPrepareStatement |
public class com.arsi.mj.maprpt.entity.etlgen.DefaultDataEntityEtlGenerator
extends com.arsi.mj.maprpt.entity.etlgen.DefaultEtlGeneratorBase
implements com.arsi.mj.maprpt.entity.etlgen.IDataEntityEtlGenerator
Fields |
File that contains complete Scriptella template for generated ETL script that inserts entity rows.public static final java.lang.String INSERT_ENTITY_ETL_TEMPLATE = "com/arsi/mj/maprpt/entity/etlgen/model/insert_entity_table_etl.xml.ftl"
|
Prefix of temporary table used to map previously generated keys to Mapper line numbers.public static final java.lang.String TEMP_KEYMAP_TABLE_PREFIX = "TMP_"
|
Constructors |
public DefaultDataEntityEtlGenerator()
|
Methods |
public java.lang.String currentTimestampSqlBinding()
|
public java.lang.String emptyClobSqlBinding()
|
public java.lang.String etlUserSqlBinding()
|
public com.arsi.mj.NameValuePair generateCreateTempTable(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
public java.io.Reader generateCSV(java.util.Iterator aTupleIterator, java.lang.String aPersistentEntityClassName, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, com.arsi.mj.maprpt.entity.etlgen.config.IEtlConfig anEtlConfig, com.arsi.mj.maprpt.entity.etlgen.InsertSQL anInsertSQL, org.springframework.context.ApplicationContext anAppCtx, int aReportNumber, com.arsi.mj.maprpt.entity.etlgen.bnfkey.IBinaryFindKeyBuilder aBnfKeyBuilder)
|
public com.arsi.mj.NameValuePair generateDropTempTable(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
public com.arsi.mj.maprpt.entity.etlgen.InsertSQL generateInsertSQL(java.lang.String aPersistentEntityClassName, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, java.util.List someInlineHandlers)
|
public com.arsi.mj.NameValuePair generateScriptella(java.lang.String aPersistentEntityClassName, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, java.util.List someInlineHandlers, com.arsi.mj.maprpt.entity.etlgen.config.IEtlConfig anEtlConfig, com.arsi.mj.maprpt.entity.etlgen.InsertSQL anInsertEntitySQL, com.arsi.mj.maprpt.entity.etlgen.InsertSQL anInsertTempSQL, java.lang.String aMapperReportDescription)
|
public java.lang.String nullClobSqlBinding()
|
public java.lang.String surrogateKeyCurrentSqlBinding(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
public java.lang.String surrogateKeyNextSqlBinding(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
public abstract class com.arsi.mj.maprpt.entity.etlgen.DefaultEtlGeneratorBase
extends java.lang.Object
Inner Class SQLInterceptor |
Hibernate interceptor that captures insert SQL.
protected static class com.arsi.mj.maprpt.entity.etlgen.DefaultEtlGeneratorBase.SQLInterceptor
|
protected DefaultEtlGeneratorBase.SQLInterceptor() public java.lang.String onPrepareStatement(java.lang.String sql)
|
Fields |
Mapper pseudo-column directive for cabinet number in original Mapper report.public static final java.lang.String CABINET_MAPPER_PSEUDO_COLNAME = "%%mprCabinet"
|
Mapper pseudo-column directive that acts as stand-in for currentTimestampSqlBinding().public static final java.lang.String CURRTIMESTAMP_MAPPER_PSEUDO_COLNAME = "%%mjCurrentTimestamp"
|
Mapper pseudo-column directive for drawer letter in original Mapper report.public static final java.lang.String DRAWER_MAPPER_PSEUDO_COLNAME = "%%mprDrawer"
|
Mapper pseudo-column directive that acts as stand-in for emptyClobSqlBinding().public static final java.lang.String EMPTYCLOB_MAPPER_PSEUDO_COLNAME = "%%mjEmptyClob"
|
Mapper pseudo-column directive that acts as stand-in for etlUserSqlBinding().public static final java.lang.String ETLUSER_MAPPER_PSEUDO_COLNAME = "%%mjEtlUser"
|
Hibernate configuration property for closing session on transaction commit or rollback.public static final java.lang.String HIBERNATE_TXN_AUTO_CLOSE_SESSION = "hibernate.transaction.auto_close_session"
|
Database dialect in use by Hibernate.protected final org.hibernate.dialect.Dialect hibernateDialect
|
Mapper pseudo-column directive that acts as stand-in for surrogateKeySqlBinding().public static final java.lang.String ID_MAPPER_PSEUDO_COLNAME = "%%mjSurrogateKey"
|
Mapper pseudo-column for line number in original Mapper report.public static final java.lang.String LINENUMBER_MAPPER_PSEUDO_COLNAME = "__mprLinenum"
|
Mapper pseudo-column for line type (as enumeration) of line in Mapper report.public static final java.lang.String LINETYPE_ENUM_MAPPER_PSEUDO_COLNAME = "__mjLinetypeEnum"
|
Mapper pseudo-column directive that acts as stand-in for nullClobSqlBinding().public static final java.lang.String NULLCLOB_MAPPER_PSEUDO_COLNAME = "%%mjNullClob"
|
Prefix for all Mapper pseudo column names that cannot be evaluated without translation.public static final java.lang.String PSEUDO_COLNAME_REQXLT_PREFIX = "%%"
|
Mapper pseudo-column directive for report number in original Mapper report.public static final java.lang.String REPORT_MAPPER_PSEUDO_COLNAME = "%%mprReport"
|
Mapper pseudo-column for report number (as enumeration) of line in Mapper report.public static final java.lang.String REPORTNUMBER_ENUM_MAPPER_PSEUDO_COLNAME = "__mjRptnumEnum"
|
Mapper pseudo-column for report number range (as enumeration) of line in Mapper report.public static final java.lang.String REPORTRANGE_ENUM_MAPPER_PSEUDO_COLNAME = "__mjRptrngEnum"
|
Name of table that serves as prototype temp table for mapping previously generated keys.public static final java.lang.String TEMP_KEYMAP_PROTOTYPE_TABLE_NAME = "MJ_TEMP_KEYMAP_PROTOTYPE"
|
Constructors |
protected DefaultEtlGeneratorBase()
|
Methods |
Factory method for creating InsertSQLPlaceholder instances.
protected com.arsi.mj.maprpt.entity.etlgen.InsertSQLPlaceholder createInsertSQLPlaceholder(org.hibernate.mapping.Property aProperty, org.hibernate.mapping.Property aComponentProperty, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, java.util.List someInlineHandlers, int aQmidxAndStartIdxAndLength, java.util.Set someUniqueEtlNames)
|
public java.lang.String dialectToScriptellaDriverName(org.hibernate.dialect.Dialect aDialect)
|
protected java.lang.String doCurrentTimestampSqlBinding()
|
protected java.lang.String doEmptyClobSqlBinding()
|
protected java.lang.String doEtlUserSqlBinding()
|
protected java.lang.String doNullClobSqlBinding()
|
protected java.lang.String doSurrogateKeyCurrentSqlBinding(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
protected java.lang.String doSurrogateKeyNextSqlBinding(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
Fill a prototype persistent POJO with non-NULL default values for all basic
types supported by MJ, including enumerations. References in the POJO to
one-to-one or child relationships are not set to non-NULL values.
protected java.lang.Object fillPrototypeObject(java.lang.Object aPrototypeObject)
|
protected java.util.Map getJdbcVariableMapForFreemarker(com.arsi.mj.maprpt.entity.etlgen.config.IEtlConfig anEtlConfig)
|
Given an IGenericEnum enumeration class, get the first constant defined
in the enumeration as a sample enumeration value.
protected java.lang.Enum getSampleEnumConstant(java.lang.Class anEnumClass)
|
Make a guess if the specified name is a simple Mapper column name or not.
public static boolean guessIfMapperName(java.lang.String aName)
|
protected com.arsi.mj.maprpt.entity.etlgen.InsertSQL interceptSQL(java.lang.String aPersistentEntityClassName, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, java.util.List someInlineHandlers, java.lang.Object aPrototypeObject)
|
Make the specified into a valid ETL variable name that cab be used in
both ETL expressions and headings in a CSV text file.
public static java.lang.String makeEtlName(java.lang.String aName)
|
Parse question mark place holders from VALUES clause of INSERT SQL.
public static java.util.List parsePlaceholderFromInsertSQL(java.lang.String anInsertSQL)
|
protected java.lang.String substituteInsertSQLPlaceholders(com.arsi.mj.maprpt.entity.etlgen.InsertSQL anInsertSQL, com.arsi.mj.maprpt.entity.etlgen.IDataEntityEtlGenerator anEntityGenerator, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, java.lang.String aSurrogateKeyNextSqlBinding)
|
public interface com.arsi.mj.maprpt.entity.etlgen.IDataEntityEtlGenerator
Methods |
Get the INSERT SQL binding to place into the ETL script for the current timestamp.
public java.lang.String currentTimestampSqlBinding()
|
Get the INSERT SQL binding to place into the ETL script for an EMPTY CLOB column.
This may be the same as a NULL CLOB column, bur this method allows for a distinction
between the two.
public java.lang.String emptyClobSqlBinding()
|
Get the INSERT SQL binding to place into the ETL script for the current time stamp,
e.g., systimestamp in Oracle.
public java.lang.String etlUserSqlBinding()
|
Generate SQL to create the temporary table used to load related keys into child
tables and auxiliary tables of the data entity table.
public com.arsi.mj.NameValuePair generateCreateTempTable(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
Generate comma-separated values (CSV) output that contains data lines from a Mapper
report suitable for loading into a data entity's database table.
public java.io.Reader generateCSV(java.util.Iterator aTupleIterator, java.lang.String aPersistentEntityClassName, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, com.arsi.mj.maprpt.entity.etlgen.config.IEtlConfig anEtlConfig, com.arsi.mj.maprpt.entity.etlgen.InsertSQL anInsertSQL, org.springframework.context.ApplicationContext anAppCtx, int aReportNumber, com.arsi.mj.maprpt.entity.etlgen.bnfkey.IBinaryFindKeyBuilder aBnfKeyBuilder)
|
Generate SQL to drop the temporary table used to load related keys into child
tables and auxiliary tables of the data entity table.
public com.arsi.mj.NameValuePair generateDropTempTable(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
Create an object that describes the SQL statement used to insert new rows into
a data entity, including place holders in the VALUES clause of the INSERT SQL.
public com.arsi.mj.maprpt.entity.etlgen.InsertSQL generateInsertSQL(java.lang.String aPersistentEntityClassName, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, java.util.List someInlineHandlers)
|
Generate ETL script for loading the database table for the data entity defined for a
Mapper report with data tuples (rows) from the report.
public com.arsi.mj.NameValuePair generateScriptella(java.lang.String aPersistentEntityClassName, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, java.util.List someInlineHandlers, com.arsi.mj.maprpt.entity.etlgen.config.IEtlConfig anEtlConfig, com.arsi.mj.maprpt.entity.etlgen.InsertSQL anInsertEntitySQL, com.arsi.mj.maprpt.entity.etlgen.InsertSQL anInsertTempSQL, java.lang.String aMapperReportDescription)
|
Get the INSERT SQL binding to place into the ETL script for a NULL CLOB column.
public java.lang.String nullClobSqlBinding()
|
Get the INSERT SQL binding to place into the ETL script for the current
surrogate key value, e.g., myseq.currval in Oracle.
public java.lang.String surrogateKeyCurrentSqlBinding(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
Get the INSERT SQL binding to place into the ETL script for the next surrogate
key value, e.g., myseq.nextval in Oracle.
public java.lang.String surrogateKeyNextSqlBinding(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
public interface com.arsi.mj.maprpt.entity.etlgen.IInlineDataEtlGenerator
Methods |
public java.io.Reader generateCSV(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
public java.lang.String generateScriptella(java.lang.String aTempTable, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, int anEntityNum, com.arsi.mj.maprpt.parser.tuple.inline.IInlineDataHandler anInlineHandler, java.lang.String aMapperReportDescription)
|
public interface com.arsi.mj.maprpt.entity.etlgen.ILineMetadataEtlGenerator
Methods |
public java.io.Reader generateCSV(com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler)
|
public java.lang.String generateScriptella(java.lang.String aTempTable, com.arsi.mj.maprpt.entity.handler.DataEntityHandler anEntityHandler, java.lang.String aMapperReportDescription)
|
public class com.arsi.mj.maprpt.entity.etlgen.InsertSQL
extends java.lang.Object
public class com.arsi.mj.maprpt.entity.etlgen.InsertSQLPlaceholder
extends java.lang.Object
public class com.arsi.mj.maprpt.entity.etlgen.PredefinedObjectFactory
extends java.lang.Object
Constructors |
public PredefinedObjectFactory()
|
Methods |
Create a data entity handler instance for the key map temporary prototype
persistent entity (the prototype is used as the basis for a temporary table
that maps previously generated keys to Mapper line numbers for a "real"
data entity). A data entity handler is typically configured as a Spring bean but we can hard code everything for the prototype since it never varies and must always exist for MJ's ETL capabilities to function properly.
public static com.arsi.mj.maprpt.entity.handler.DataEntityHandler createEntityHandlerForTempKeyMapPrototype()
|
org.hibernate.Interceptor.onPrepareStatement
once SQL has been obtained.
public class com.arsi.mj.maprpt.entity.etlgen.VetoOnPrepareException
extends java.lang.RuntimeException
Constructors
public VetoOnPrepareException()