public class TempTableBuilder extends AbstractTempTable
TempTable
interface is needed by CommonHandle
in order to store the handle to the table.AbstractTempTable.CallingFunction
TempTable.BeforeType
Modifier and Type | Field and Description |
---|---|
private boolean |
addFunctionCalled
Flag that indicates that an ADD-* function was called for the table (CLEAR function resets
this flag).
|
private static java.util.Set<java.lang.Character> |
allowedSpecialChars
Special characters (not letters or digits) allowed in dynamic table names.
|
private static java.util.Map<java.lang.String,java.lang.Integer> |
datatypesMatchLen
Used during data type name validation.
|
private static java.lang.String |
DATETIMETZ_TYPE_NAME
datetime-tz 4GL type name.
|
private static java.util.Map<java.lang.String,java.lang.String> |
defaultFormatStrings
Data type name to default format string.
|
private boolean |
deleted
Determines if the table object was deleted.
|
private java.lang.Class<? extends TempTableBuffer> |
dmoBufIface
Generated DMO buffer class.
|
private java.lang.Class<? extends DataModelObject> |
dmoIface
Generated DMO buffer class.
|
private DmoMeta |
dmoInfo
Object which contains metadata about the DMO.
|
private java.util.Map<java.lang.String,P2JField> |
fields
Table fields keyed by their legacy normalized names.
|
private java.util.Map<java.lang.String,P2JIndex> |
indexes
Table indexes keyed by their normalized names.
|
private boolean |
postponedDelete
Flag indicating the delete was explicitly called for a BY-REFERENCE handle.
|
admData, beforeTableType, DEFAULT_COPY_TEMP_TABLE_PREFIX, defaultBufferHandle, error, errorString, peerTable, SM_DEFAULT, SM_FULL, SM_MIN, SM_NONE, undoable
name, nextSibling, prevSibling
instProc
SCHEMA_MARSHAL_FULL, SCHEMA_MARSHAL_MIN, SCHEMA_MARSHAL_NONE
Constructor and Description |
---|
TempTableBuilder()
Create a new TEMP-TABLE resource.
|
Modifier and Type | Method and Description |
---|---|
boolean |
_clear()
Check whether this TEMP-TABLE is in CLEAR state: I.e.
|
boolean |
_dynamic()
Checks whether the resource is dynamic or static.
|
boolean |
_prepared()
Returns
true if this temp-table is in prepared state (after a successful call
to tempTablePrepare(java.lang.String) ). |
private void |
addAllFields(java.util.Collection<P2JField> fields)
Add all fields from the given collection to the table.
|
private void |
addAllIndexes(java.util.Collection<P2JIndex> indexes)
Add all indexes from the given collection to the table.
|
void |
addField(P2JField field)
Add new field to the table.
|
logical |
addFieldLike(character name,
character source)
Adds to the temp-table a field like the one specified.
|
logical |
addFieldLike(character name,
handle source)
Adds to the temp-table a field like the one specified.
|
logical |
addFieldLike(java.lang.String name,
handle source)
Adds to the temp-table a field like the one specified.
|
logical |
addFieldLike(java.lang.String name,
java.lang.String source)
Adds to the temp-table a field like the one specified.
|
logical |
addFieldsFrom(character tableName)
Adds fields from another table into this temp-table.
|
logical |
addFieldsFrom(character tableName,
character except)
Adds fields from another table into this temp-table.
|
logical |
addFieldsFrom(handle hbuf)
Adds fields from another table into this temp-table.
|
logical |
addFieldsFrom(handle hbuf,
character except)
Adds fields from another table into this temp-table.
|
logical |
addFieldsFrom(handle hbuf,
java.lang.String except)
Adds fields from another table into this temp-table.
|
logical |
addFieldsFrom(java.lang.String tableName)
Adds fields from another table into this temp-table.
|
logical |
addFieldsFrom(java.lang.String tableName,
character except)
Adds fields from another table into this temp-table.
|
logical |
addFieldsFrom(java.lang.String tableName,
java.lang.String except)
Adds fields from another table into this temp-table.
|
logical |
addFieldToIndex(character indexName,
character field)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(character indexName,
character field,
character ascending)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(character indexName,
character field,
java.lang.String ascending)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(character indexName,
java.lang.String field)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(character indexName,
java.lang.String field,
character ascending)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(character indexName,
java.lang.String field,
java.lang.String ascending)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(java.lang.String indexName,
character field)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(java.lang.String indexName,
character field,
character ascending)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(java.lang.String indexName,
character field,
java.lang.String ascending)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(java.lang.String indexName,
java.lang.String field)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(java.lang.String indexName,
java.lang.String field,
character ascending)
Construct an index of this temp-table by adding a new field to it.
|
logical |
addFieldToIndex(java.lang.String indexName,
java.lang.String field,
java.lang.String ascending)
Construct an index of this temp-table by adding a new field to it.
|
protected boolean |
addFunctionWasCalled()
Determine if an ADD-* function was called for the table (CLEAR function resets the state).
|
private void |
addIndex(P2JIndex index)
Add new index to the table.
|
logical |
addIndexLike(character name,
character sourceName,
character dbTable)
Adds to the temp-table an index like the one specified.
|
logical |
addIndexLike(character name,
character sourceName,
handle sourceBuffer)
Adds to the temp-table an index like the one specified.
|
private logical |
addIndexLike(P2JIndex srcIndex)
Adds to the temp-table an index like the one specified.
|
logical |
addIndexLike(java.lang.String name,
java.lang.String sourceName,
handle sourceBuffer)
Adds to the temp-table an index like the one specified.
|
logical |
addIndexLike(java.lang.String name,
java.lang.String sourceName,
java.lang.String dbTable)
Adds to the temp-table an index like the one specified.
|
logical |
addNewField(character name,
character type)
Adds a field with the specified properties to the temp-table.
|
logical |
addNewField(character name,
character type,
integer extent)
Adds a field with the specified properties to the temp-table.
|
logical |
addNewField(character name,
character type,
integer extent,
character format)
Adds a field with the specified properties to the temp-table.
|
logical |
addNewField(character name,
character type,
integer extent,
character format,
BaseDataType initial)
Adds a field with the specified properties to the temp-table.
|
logical |
addNewField(character name,
character type,
integer extent,
character format,
BaseDataType initial,
character label)
Adds a field with the specified properties to the temp-table.
|
logical |
addNewField(character name,
character type,
integer extent,
character format,
BaseDataType initial,
character label,
character columnLabel)
Adds a field with the specified properties to the temp-table.
|
protected void |
addNewField(PropertyDefinition propertyDefinition)
Add new field from property definition data.
|
logical |
addNewIndex(character name)
Adds a new empty index with the specified name to the temp-table.
|
logical |
addNewIndex(character name,
logical unique)
Adds a new empty index with the specified name to the temp-table.
|
logical |
addNewIndex(character name,
logical unique,
logical primary)
Adds a new empty index with the specified name to the temp-table.
|
logical |
addNewIndex(character name,
logical unique,
logical primary,
logical word)
Adds a new empty index with the specified name to the temp-table.
|
static TempTable |
asTempTable(Temporary buf)
Get the TEMP-TABLE associated with this temporary buffer.
|
static handle |
buffer(Buffer buf)
Get the BUFFER handle associated with this temporary buffer.
|
private static P2JField |
buildField(Property prop,
ParmType parmType,
BaseDataType initialValue)
Build a
P2JField instance with the specified details. |
logical |
clear()
Returns the temp-table to it's clear state, removing all defined fields, indexes, all
records in the table and all corresponding buffers.
|
private P2JField |
copyField(java.lang.String targetName,
P2JField srcField)
Returns a new field with the new specified name and all other parameters copied from the
source field.
|
private P2JIndex |
copyIndex(P2JIndex srcIndex)
Returns a new index with all parameters copied from the source index.
|
static void |
create(handle tth)
Dynamically creates a temporary table at runtime and assign it to a
handle.
|
static void |
create(handle tth,
character widgetPool)
Dynamically creates a temporary table at runtime and assign it to a
handle.
|
static void |
create(handle tth,
java.lang.String widgetPool)
Dynamically creates a temporary table at runtime and assign it to a
handle.
|
(package private) boolean |
createBeforeTable(java.lang.String beforeName)
Creates the before table and link it to current table.
|
private void |
createDefaultBuffer()
Create default buffer for the table.
|
void |
createFromTableWrapper(TableWrapper tableWrapper,
int tableParameterIndex)
Build temporary table from a table wrapper object.
|
logical |
createLike(character tableName)
Duplicates the structure of an existing table, copying the field
definitions, and optionally, the indexes.
|
logical |
createLike(character tableName,
character indexName)
Duplicates the structure of an existing table, copying the field
definitions, and optionally, the indexes.
|
logical |
createLike(handle hbuf)
Duplicates the structure of an existing table, copying the field
definitions, and optionally, the indexes.
|
logical |
createLike(handle hbuf,
character indexName)
Duplicates the structure of an existing table, copying the field
definitions, and optionally, the indexes.
|
logical |
createLike(handle hbuf,
java.lang.String indexName)
Duplicates the structure of an existing table, copying the field
definitions, and optionally, the indexes.
|
logical |
createLike(java.lang.String tableName)
Duplicates the structure of an existing table, copying the field
definitions, and optionally, the indexes.
|
logical |
createLike(java.lang.String tableName,
java.lang.String indexName)
Duplicates the structure of an existing table, copying the field
definitions, and optionally, the indexes.
|
static BufferImpl |
createRemoteTable(java.lang.String tableName,
java.util.Iterator<PropertyDefinition> props,
java.lang.String tableIndexes,
java.lang.String xmlns,
java.lang.String xmlPrefix)
Create a temp-table with the specified definition, as received from a remote side.
|
private logical |
createTableLikeImpl(character tableName,
character indexName,
boolean handleIndex)
Duplicates the structure of an existing table, copying the field definitions, and
optionally, the indexes.
|
private logical |
createTableLikeImpl(handle hbuf,
character indexName,
boolean handleIndex)
Duplicates the structure of an existing table, copying the field
definitions, and optionally, the indexes.
|
handle |
defaultBufferHandle()
Obtain the handle to the buffer that was created by default for this
temporary table.
|
private void |
displayCouldNotFindAddIndex(java.lang.String indexName)
Display "Could not find index {indexName} during ADD-INDEX-FIELD" error message.
|
private void |
displayCouldNotFindLikeField(java.lang.String fieldName)
Display "Could not find source field {fieldName} during ADD-LIKE-FIELD." error message.
|
private void |
displayCouldNotFindLikeIndex(java.lang.String tableName,
java.lang.String indexName)
Display "ADD-LIKE-INDEX could not find index {indexName} in table {tableName}" error
message.
|
private void |
displayCouldNotFindLikeTable(java.lang.String tableName)
Display "Could not find table {tableName} during ADD-LIKE-FIELD.
|
private void |
displayCouldNotFindLikeTableName(java.lang.String tableName)
Display "TEMP-TABLE method could not find LIKE table name {tableName}}" error message.
|
private void |
displayDuplicateIndex(java.lang.String indexName)
Display "Duplicate index name {indexName} for temp-table" error message.
|
private void |
displayDuplicateOrInvalidIndexField(java.lang.String indexName,
java.lang.String fieldName)
Display "Attempt to add duplicate or inappropriate word index field {fieldName} to index
{indexName}" error message.
|
private void |
displayUnableToCreateLikeIndex()
Display "Unable to create index for TEMP-TABLE in ADD-LIKE-INDEX" error message.
|
private void |
displayUnableToEvaluate()
Display "Unable to evaluate arguments for TEMP-TABLE method" error message.
|
private void |
displayUnableToFindIndex(java.lang.String tableName,
java.lang.String indexName)
Display "Unable to find index {indexName} in table {tableName}" error message.
|
private void |
displayUnableToPrepareTableFields()
Display "Unable to prepare TEMP-TABLE fields" error message.
|
private void |
displayUnableToPrepareTableIndices()
Display "Unable to prepare TEMP-TABLE indices" error message.
|
private void |
doAddFieldsFrom(java.util.Collection<P2JField> srcFields,
character except)
Add specified set of fields to the table.
|
logical |
dynamic()
Checks whether the resource is dynamic or static.
|
private Persistence |
findExistingTable(java.lang.String fullTableName,
boolean tableNameSearch)
Search for an existing table with the specified name.
|
private static P2JIndex |
findIndexByName(java.util.Collection<P2JIndex> indexes,
java.lang.String indexName)
Find index in the collection of indexes by its name.
|
private boolean |
forceClear()
Unconditionally delete all buffers for this table, drop DMO definitions and temporary table,
clear TEMP-TABLE data structures.
|
void |
forceDelete()
Unconditionally delete all buffers for this table, drop DMO definitions and temporary table,
clear TEMP-TABLE data structures and mark the table as deleted (i.e.
|
java.lang.String |
getCodePage(java.lang.String property)
Get code page of the specified CLOB field.
|
java.util.function.Supplier |
getCodePageSupplier(java.lang.String property)
Get code page supplier of the specified CLOB field.
|
static java.lang.String |
getDefaultDataTypeFormat(java.lang.String datatype)
Get default format for the given data type.
|
java.lang.Class<? extends TempTableBuffer> |
getDMOBufInterface()
Get buffer interface which backs this table.
|
java.lang.Class<? extends Record> |
getDMOClass()
Get DMO implementation class associated with this table.
|
java.lang.Class<? extends DataModelObject> |
getDMOInterface()
Get DMO interface which backs this table.
|
DmoMeta |
getDmoMeta()
Obtain the
DmoMeta structure which contains the legacy meta information. |
static P2JField |
getExistingField(Persistence persistence,
java.lang.String tableName4GL,
java.lang.String fieldName4GL)
Get the field (legacy name) of an existing table.
|
static P2JField |
getExistingField(RecordBuffer buffer,
java.lang.String propertyName)
Get the field of an existing table.
|
static java.util.Collection<P2JField> |
getExistingFields(Persistence persistence,
java.lang.String tableName4GL)
Get the fields of an existing table.
|
static java.util.Collection<P2JField> |
getExistingFields(RecordBuffer buffer)
Get the fields of an existing table.
|
static P2JIndex |
getExistingIndex(Persistence persistence,
java.lang.String tableName4GL,
java.lang.String indexName4GL)
Get the index of an existing table.
|
static P2JIndex |
getExistingIndex(RecordBuffer buffer,
java.lang.String indexName4GL)
Get the index of an existing table.
|
static java.util.Collection<P2JIndex> |
getExistingIndexes(Persistence persistence,
java.lang.String tableName4GL)
Get the indexes of an existing table.
|
static java.util.Collection<P2JIndex> |
getExistingIndexes(RecordBuffer buffer)
Get the indexes of an existing table.
|
static TempTable |
getExistingTempTable(java.lang.String normalizedTableName4GL)
Get the active static temp table with the given name.
|
P2JField |
getField(java.lang.String fieldName)
Get field by its name.
|
java.util.Collection<P2JField> |
getFields()
Get the collection of table fields.
|
P2JIndex |
getIndex(java.lang.String indexName)
Get index by its name.
|
java.util.Collection<P2JIndex> |
getIndexes()
Get table indexes.
|
static java.lang.String |
getLegacyTableName(RecordBuffer buffer)
Get legacy table name.
|
static java.lang.String[] |
getOrderedPropertyNames(java.lang.Class<? extends DataModelObject> dmoIface,
TempTable tempTable)
Get the array of Hibernate property names ordered in the same way as they were specified in
4GL for the given table.
|
static java.lang.String[] |
getPropertyNamesArray(java.lang.Class<? extends DataModelObject> dmoIface,
TempTable tempTable)
Get the array of Hibernate property names ordered in the same way as they were specified in
4GL for the given table (for the possible denormalized tables).
|
private boolean |
hasField(java.lang.String fieldName)
Checks whether the field with specified name already exist.
|
private boolean |
hasIndex(java.lang.String indexName)
Checks whether the index with specified name already exist.
|
protected boolean |
hasNameConstraints()
Allows each resource to declare whether it has some naming constraints.
|
protected boolean |
hasNameReadOnly()
Check if this resource supports the NAME attribute only in read-only mode.
|
protected boolean |
hasNextSibling()
Check if this resource supports the NEXT-SIBLING attribute.
|
protected boolean |
hasPrevSibling()
Check if this resource supports the PREV-SIBLING attribute.
|
private boolean |
hasSameNormalizedName(java.lang.String name1,
java.lang.String name2)
Determines if two names has the same normalized form.
|
(package private) boolean |
isPostponedDelete()
Check if this temp-table was attempted to be deleted, but was postponed because of the handle
being a TABLE-HANDLE BY-REFERENCE.
|
character |
name()
Get table NAME attribute.
|
void |
name(character name)
Set table NAME attribute.
|
private java.util.Set<java.lang.String> |
parseFieldList(character list)
Split comma-separated list of field names into the set of separate field names.
|
protected boolean |
resourceDelete()
Worker to be implemented by each resource.
|
void |
setCodePage(java.lang.String property,
java.lang.String codePage)
Set code page for the specified CLOB field.
|
void |
setCodePageSupplier(java.lang.String property,
java.util.function.Supplier supplier)
Set code page supplier for the specified CLOB field.
|
(package private) void |
setDmoIface(DmoMeta dmoInfo,
java.lang.Class<? extends DataModelObject> dmoIface,
java.lang.Class<? extends TempTableBuffer> dmoBufIface)
Set DMO interface class which corresponds the table.
|
void |
setPostponedDelete(boolean postponed)
Set the
postponedDelete flag. |
static handle |
tempTable(Temporary buf)
Get the TEMP-TABLE handle associated with this temporary buffer.This allows chaining of
methods/attributes on a buffer using its TEMP-TABLE interface.
|
logical |
tempTablePrepare(character name)
Signals that all the field and index definitions for a temp-table have been provided.
|
logical |
tempTablePrepare(character name,
boolean before)
Signals that all the field and index definitions for a temp-table have been provided.
|
logical |
tempTablePrepare(character name,
logical before)
Signals that all the field and index definitions for a temp-table have been provided.
|
logical |
tempTablePrepare(java.lang.String name)
Signals that all the field and index definitions for a temp-table have been provided.
|
logical |
tempTablePrepare(java.lang.String name,
boolean before)
Signals that all the field and index definitions for a temp-table have been provided.
|
logical |
tempTablePrepare(java.lang.String name,
logical before)
Signals that all the field and index definitions for a temp-table have been provided.
|
(package private) logical |
tempTablePrepareImpl(java.lang.String tableName,
java.lang.String beforeName)
The implementation of
TEMP-TABLE-PREPARE method. |
java.lang.String |
toString()
Returns a string representation of the object.
|
boolean |
valid()
Reports if this object is valid for use.
|
static ParmType |
validateDatatype(java.lang.String datatype)
Validates data type name which was passed to ADD-NEW-FIELD function.
|
static void |
validateDateFormatOnAddNewField(java.lang.String fmt)
Validates date format on adding new field.
|
static boolean |
validateFormat(ParmType parmType,
java.lang.String format)
Validate format for the given data type.
|
_hasRecords, canUndo, changeErrorString, copyTempTable, copyTempTable, copyTempTable, copyTempTable, copyTempTable, copyTempTable, copyTempTable, copyTempTable, copyTempTable, defaultBuffer, deleteAll, deleteAllBuffers, deleteAllImpl, dereference, dereference, dereference, deregisterBuffer, displayCannotClear, displayCopyTempTableHalfDefined, displayCopyTempTableInvalidFirstArg, displayCouldNotFindLikeTableFromHandle, displayCreateLikeNotFirst, displayNotPrepared, displayPrepared, displayPreparedIgnoring, displayUnableAddFieldsFrom, displayUnableAssignUnknownUndo, displayUnableCreateLike, displayUninitialized, error, error, error, errorString, getADMData, getAfterTable, getBeforeTable, getOriginHandle, getRecordBufferByHandle, getSchemaMarshal, getSchemaMarshalLevel, getSerializeName, getUniqueID, getXmlDataType, getXmlNodeName, getXmlNodeType, hasRecords, isDataSourceModified, isMinSchemaMarshal, isNoSchemaMarshal, isTrackingChanges, isUndoable, namespacePrefix, namespacePrefix, namespacePrefix, namespaceURI, namespaceURI, namespaceURI, prepared, readJson, readJson, readXml, readXml, readXml, readXmlSchema, readXmlSchema, readXmlSchema, registerBuffer, rejected, rejected, rejected, setADMData, setADMData, setCanUndo, setDataSourceModified, setDataSourceModified, setMinSchemaMarshal, setMinSchemaMarshal, setNoSchemaMarshal, setNoSchemaMarshal, setOriginTable, setSchemaMarshal, setSchemaMarshal, setSerializeName, setSerializeName, setTrackingChanges, setTrackingChanges, setXmlDataType, setXmlDataType, setXmlNodeName, setXmlNodeName, setXmlNodeType, setXmlNodeType, tableDefinition, validateAllBuffers, writeJson, writeJson, writeJson, writeJson, writeJson, writeJson, writeXml, writeXml, writeXml, writeXml, writeXml, writeXml, writeXml, writeXml, writeXmlSchema, writeXmlSchema, writeXmlSchema, writeXmlSchema, writeXmlSchema
delete, firstResource, firstResource, getHead, getNextSibling, getNextSibling, getPrevSibling, getPrevSibling, getPrivateData, getTail, hasName, hasParent, hasPrivateData, interlink, isChained, lastResource, lastResource, moveInChain, name, readOnlyError, readOnlyError, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData, validateName
doDelete, getResourceType, id, id, implicitDeletion, incrementTrigger, instantiatingProcedure, invalidAttribute, processResource, registerResource, setInstantiatingProcedure, type, unableToAssignUnknown, unknown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNextSibling, getPrevSibling, getPrivateData, setPrivateData, setPrivateData
getResourceType, readOnlyError, readOnlyError
id, id, unknown
isDataSourceModified
dereference, dereference, dereference, dereference
instantiatingProcedure
private static final java.lang.String DATETIMETZ_TYPE_NAME
private static final java.util.Set<java.lang.Character> allowedSpecialChars
private static final java.util.Map<java.lang.String,java.lang.Integer> datatypesMatchLen
private static final java.util.Map<java.lang.String,java.lang.String> defaultFormatStrings
private final java.util.Map<java.lang.String,P2JField> fields
private final java.util.Map<java.lang.String,P2JIndex> indexes
private DmoMeta dmoInfo
private java.lang.Class<? extends DataModelObject> dmoIface
private java.lang.Class<? extends TempTableBuffer> dmoBufIface
private boolean deleted
private boolean addFunctionCalled
private boolean postponedDelete
public static BufferImpl createRemoteTable(java.lang.String tableName, java.util.Iterator<PropertyDefinition> props, java.lang.String tableIndexes, java.lang.String xmlns, java.lang.String xmlPrefix)
tableName
- The table name.props
- The property definitions.tableIndexes
- The index definitions.xmlns
- The XML namespace.xmlPrefix
- The XML prefix.public static void create(handle tth, java.lang.String widgetPool)
CREATE TEMP-TABLE
statement of Progress 4GL.tth
- The handle to assign the newly created temporary table to.widgetPool
- The name of the widget pool that contains the temp-table. null
if the
unnamed pool must be used.public static void create(handle tth, character widgetPool)
CREATE TEMP-TABLE
statement of Progress 4GL.tth
- The handle to assign the newly created temporary table to.widgetPool
- The name of the widget pool that contains the temp-table. null
if the
unnamed pool must be used.public static void create(handle tth)
CREATE TEMP-TABLE
statement of Progress 4GL.tth
- The handle to assign the newly created temporary table to.public static handle buffer(Buffer buf)
buf
- A temporary buffer for which the associated BUFFER resource is needed.public static handle tempTable(Temporary buf)
buf
- A temporary buffer for which the associated TEMP-TABLE resource is needed.public static TempTable asTempTable(Temporary buf)
TempTable
the tempTable(com.goldencode.p2j.persist.Temporary)
should be used as it allows to correctly generate
the 4052 error message (~ is not a queryable attribute for ~).buf
- A temporary buffer for which the associated TEMP-TABLE resource is needed.public static TempTable getExistingTempTable(java.lang.String normalizedTableName4GL)
normalizedTableName4GL
- Normalized legacy name of the temp table.null
if a table wasn't
found by the given name.public static P2JField getExistingField(Persistence persistence, java.lang.String tableName4GL, java.lang.String fieldName4GL)
persistence
- Persistence which corresponds the target database.tableName4GL
- 4GL table name.fieldName4GL
- 4GL field name.null
if there is no such field.public static P2JField getExistingField(RecordBuffer buffer, java.lang.String propertyName)
buffer
- A record buffer which backs records of the target table.propertyName
- The property name.null
if there is no such field.public static P2JIndex getExistingIndex(RecordBuffer buffer, java.lang.String indexName4GL)
buffer
- A record buffer which backs records of the target table.indexName4GL
- 4GL index name.null
if there is no such index.public static P2JIndex getExistingIndex(Persistence persistence, java.lang.String tableName4GL, java.lang.String indexName4GL)
persistence
- Persistence which corresponds the target database.tableName4GL
- 4GL table name.indexName4GL
- 4GL index name.null
if there is no such index.public static java.util.Collection<P2JIndex> getExistingIndexes(Persistence persistence, java.lang.String tableName4GL)
persistence
- Persistence which corresponds the target database.tableName4GL
- 4GL table name.null
if there is no
such table.public static java.util.Collection<P2JIndex> getExistingIndexes(RecordBuffer buffer)
buffer
- A record buffer which backs records of the target table.null
if there is no
such table.public static java.util.Collection<P2JField> getExistingFields(RecordBuffer buffer)
P2JField.name
are legacy field names, not properties.
The order in which they are returned is the native order in which they were defined/added.buffer
- A record buffer which backs records of the target table.null
if there is no such table.private static P2JField buildField(Property prop, ParmType parmType, BaseDataType initialValue)
P2JField
instance with the specified details.prop
- The field's annotation.parmType
- The field's type.initialValue
- The field's initial value.public static java.util.Collection<P2JField> getExistingFields(Persistence persistence, java.lang.String tableName4GL)
persistence
- Persistence which corresponds the target database.tableName4GL
- 4GL table name.null
if there is no such table.public static java.lang.String[] getOrderedPropertyNames(java.lang.Class<? extends DataModelObject> dmoIface, TempTable tempTable)
dmoIface
- DMO interface associated with the target table.tempTable
- Temp-table object which backs the target table or null
if the table is
a permanent table.public static java.lang.String[] getPropertyNamesArray(java.lang.Class<? extends DataModelObject> dmoIface, TempTable tempTable)
dmoIface
- DMO interface associated with the target table.tempTable
- Temp-table object which backs the target table or null
if the table is
a permanent table.public static java.lang.String getLegacyTableName(RecordBuffer buffer)
buffer
- A buffer of the target table.private static P2JIndex findIndexByName(java.util.Collection<P2JIndex> indexes, java.lang.String indexName)
indexes
- Collection of indexes to be searched.indexName
- Name of the target index.null
if there is no such index.public static void validateDateFormatOnAddNewField(java.lang.String fmt) throws ErrorConditionException
fmt
- Date format.ErrorConditionException
- Date format is wrong.public static java.lang.String getDefaultDataTypeFormat(java.lang.String datatype)
datatype
- Data type (string representation as in Enum.toString()
.public static boolean validateFormat(ParmType parmType, java.lang.String format)
parmType
- Data type.format
- Format string to check.true
if format is valid.public static ParmType validateDatatype(java.lang.String datatype)
datatype
- Data type name.ParmType
or null
if validation has failed.boolean isPostponedDelete()
postponedDelete
.public void setPostponedDelete(boolean postponed)
postponedDelete
flag.postponed
- Flag indicating that delete is postponed.public logical createLike(handle hbuf, java.lang.String indexName)
CREATE-LIKE
method
of Progress 4GL.hbuf
- A handle to a buffer or table from which to copy the definitions.indexName
- The name of a single index which is copied from the source table.true
on success.public logical createLike(handle hbuf, character indexName)
CREATE-LIKE
method
of Progress 4GL.hbuf
- A handle to a buffer or table from which to copy the definitions.indexName
- The name of a single index which is copied from the source table.true
on success.public logical createLike(java.lang.String tableName, java.lang.String indexName)
CREATE-LIKE
method
of Progress 4GL.tableName
- The name of a table to create the copy of.indexName
- The name of a single index which is copied from the source table.true
on success.public logical createLike(character tableName, character indexName)
CREATE-LIKE
method
of Progress 4GL.tableName
- The name of a table to create the copy of.indexName
- The name of a single index which is copied from the source table.true
on success.public logical createLike(handle hbuf)
CREATE-LIKE
method
of Progress 4GL.hbuf
- A handle to a buffer or table from which to copy the definitions.true
on success.public logical createLike(java.lang.String tableName)
CREATE-LIKE
method
of Progress 4GL.tableName
- The name of a table to create the copy of.true
on success.public logical createLike(character tableName)
CREATE-LIKE
method
of Progress 4GL.tableName
- The name of a table to create the copy of.true
on success.public logical addNewField(character name, character type)
ADD-NEW-FIELD
method
of Progress 4GL.name
- The name of the field to be created in the temp-table.type
- The data type of the specified field.true
on success.public logical addNewField(character name, character type, integer extent)
ADD-NEW-FIELD
method
of Progress 4GL.name
- The name of the field to be created in the temp-table.type
- The data type of the specified field.extent
- An integer expression specifying the extent of an array.true
on success.public logical addNewField(character name, character type, integer extent, character format)
ADD-NEW-FIELD
method
of Progress 4GL.name
- The name of the field to be created in the temp-table.type
- The data type of the specified field.extent
- An integer expression specifying the extent of an array.format
- The data format for the defined data type. If empty or unknown, format is
replaced with default format. Null value means that format is not used in
ADD-NEW-FIELD.true
on success.public logical addNewField(character name, character type, integer extent, character format, BaseDataType initial)
ADD-NEW-FIELD
method
of Progress 4GL.name
- The name of the field to be created in the temp-table.type
- The data type of the specified field.extent
- An integer expression specifying the extent of an array.format
- The data format for the defined data type. If empty or unknown, format is
replaced with default format. Null value means that format is not used in
ADD-NEW-FIELD.initial
- An expression that evaluates to the initial value of the
defined field.
TODO: this method will probably be overloaded because of this.true
on success.public logical addNewField(character name, character type, integer extent, character format, BaseDataType initial, character label)
ADD-NEW-FIELD
method
of Progress 4GL.name
- The name of the field to be created in the temp-table.type
- The data type of the specified field.extent
- An integer expression specifying the extent of an array.format
- The data format for the defined data type. If empty or unknown, format is
replaced with default format. Null value means that format is not used in
ADD-NEW-FIELD.initial
- An expression that evaluates to the initial value of the
defined field.
TODO: this method will probably be overloaded because of this.label
- The label of the defined field. If null or unknown the name
parameter will be used.true
on success.public logical addNewField(character name, character type, integer extent, character format, BaseDataType initial, character label, character columnLabel)
ADD-NEW-FIELD
method
of Progress 4GL.
When a parameter is set to null, it means it was not specified by the business logic.
name
- The name of the field to be created in the temp-table.type
- The data type of the specified field.extent
- An integer expression specifying the extent of an array.format
- The data format for the defined data type. If empty or unknown, format is
replaced with default format. Null value means that format is not used in
ADD-NEW-FIELD.initial
- An expression that evaluates to the initial value of the defined field.
TODO: this method will probably be overloaded because of this.label
- The label of the defined field. If null
or unknown the name
parameter will be used.columnLabel
- The label of the column associated with the defined fieldtrue
on success.public logical addNewIndex(character name)
ADD-INDEX-FIELD()
method.
This method is the P2J equivalent of ADD-NEW-INDEX
method
of Progress 4GL.name
- The name of the index to be created.true
on success.public logical addNewIndex(character name, logical unique)
ADD-INDEX-FIELD()
method.
This method is the P2J equivalent of ADD-NEW-INDEX
method
of Progress 4GL.name
- The name of the index to be created.unique
- TRUE if this index is unique.true
on success.public logical addNewIndex(character name, logical unique, logical primary)
ADD-INDEX-FIELD()
method.
This method is the P2J equivalent of ADD-NEW-INDEX
method
of Progress 4GL.name
- The name of the index to be created.unique
- TRUE if this index is unique.primary
- TRUE if this is the primary index.true
on success.public logical addNewIndex(character name, logical unique, logical primary, logical word)
ADD-INDEX-FIELD()
method.
This method is the P2J equivalent of ADD-NEW-INDEX
method
of Progress 4GL.
If a parameter is null, it means it was not set.
name
- The name of the index to be created.unique
- TRUE if this index is unique.primary
- TRUE if this is the primary index.word
- TRUE if this is a word index.true
on success.public logical addFieldLike(java.lang.String name, java.lang.String source)
ADD-LIKE-FIELD
method
of Progress 4GL.name
- The name of the field to be created in the temp-table.source
- Database field name from which to copy the field. The table
name must be qualified with the database name.true
on success.public logical addFieldLike(character name, character source)
ADD-LIKE-FIELD
method
of Progress 4GL.name
- The name of the field to be created in the temp-table.source
- Database field name from which to copy the field. The table
name must be qualified with the database name.true
on success.public logical addFieldLike(java.lang.String name, handle source)
ADD-LIKE-FIELD
method of Progress 4GL.name
- The name of the field to be created in the temp-table.source
- Handle to field name from which to copy the field.true
on success.public logical addFieldLike(character name, handle source)
ADD-LIKE-FIELD
method
of Progress 4GL.name
- The name of the field to be created in the temp-table.source
- Handle to field name from which to copy the field.true
on success.public logical addFieldToIndex(java.lang.String indexName, java.lang.String field, java.lang.String ascending)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the
AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.ascending
- "asc" if the ascending ordering, "desc" for descending other -> error.true
for success.public logical addFieldToIndex(java.lang.String indexName, java.lang.String field, character ascending)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the
AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.ascending
- "asc" if the ascending ordering, "desc" for descending other -> error.true
for success.public logical addFieldToIndex(character indexName, java.lang.String field, java.lang.String ascending)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the
AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.ascending
- "asc" if the ascending ordering, "desc" for descending other -> error.true
for success.public logical addFieldToIndex(character indexName, java.lang.String field, character ascending)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the
AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.ascending
- "asc" if the ascending ordering, "desc" for descending other -> error.true
for success.public logical addFieldToIndex(java.lang.String indexName, character field, java.lang.String ascending)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the
AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.ascending
- "asc" if the ascending ordering, "desc" for descending other -> error.true
for success.public logical addFieldToIndex(java.lang.String indexName, character field, character ascending)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the
AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.ascending
- "asc" if the ascending ordering, "desc" for descending other -> error.true
for success.public logical addFieldToIndex(character indexName, character field, java.lang.String ascending)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the
AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.ascending
- "asc" if the ascending ordering, "desc" for descending other -> error.true
for success.public logical addFieldToIndex(character indexName, character field, character ascending)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the
AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.ascending
- "asc" if the ascending ordering, "desc" for descending other -> error.true
for success.public logical addFieldToIndex(java.lang.String indexName, java.lang.String field)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.true
for success.public logical addFieldToIndex(character indexName, java.lang.String field)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.true
for success.public logical addFieldToIndex(java.lang.String indexName, character field)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.true
for success.public logical addFieldToIndex(character indexName, character field)
addNewIndex(com.goldencode.p2j.util.character)
and cannot be called after the AbstractTempTable.prepared()
.indexName
- The name of the index being built.field
- The name of the temp-table to be added to the index.true
for success.public logical addIndexLike(java.lang.String name, java.lang.String sourceName, java.lang.String dbTable)
ADD-LIKE-FIELD
method
of Progress 4GL.name
- The name of the index to which the source index is being copied. Progress ignores
this option and uses the name of the source index instead.sourceName
- The name of the index in the source table that is being copied
to the temp-table.dbTable
- The database table name from which to copy the index.true
on success.public logical addIndexLike(character name, character sourceName, character dbTable)
ADD-LIKE-FIELD
method
of Progress 4GL.name
- The name of the index to which the source index is being copied. Progress ignores
this option and uses the name of the source index instead.sourceName
- The name of the index in the source table that is being copied
to the temp-table.dbTable
- The database table name from which to copy the index.true
on success.public logical addIndexLike(java.lang.String name, java.lang.String sourceName, handle sourceBuffer)
ADD-LIKE-FIELD
method
of Progress 4GL.name
- The name of the index to which the source index is being copied. Progress ignores
this option and uses the name of the source index instead.sourceName
- The name of the index in the source table that is being copied
to the temp-table.sourceBuffer
- Buffer handle from which to copy the index.true
on success.public logical addIndexLike(character name, character sourceName, handle sourceBuffer)
ADD-LIKE-FIELD
method
of Progress 4GL.name
- The name of the index to which the source index is being copied. Progress ignores
this option and uses the name of the source index instead.sourceName
- The name of the index in the source table that is being copied
to the temp-table.sourceBuffer
- Buffer handle from which to copy the index.true
on success.public boolean _prepared()
true
if this temp-table is in prepared state (after a successful call
to tempTablePrepare(java.lang.String)
).
This method implements the read-only PREPARED attribute from 4GL._prepared
in class AbstractTempTable
true
if this table is prepared.public boolean _clear()
This method is FWD-internal. The programmer can check whether the temp-table is in an UNPREPARED or PREPARED state by checking the PREPARED attribute, but the CLEAR state is transparent.
_clear
in class AbstractTempTable
true
if this table is in CLEAR state.public logical dynamic()
true
if the resource is dynamic, false
otherwise.public boolean _dynamic()
true
if the resource is dynamic, false
otherwise.public logical clear()
logical tempTablePrepareImpl(java.lang.String tableName, java.lang.String beforeName)
TEMP-TABLE-PREPARE
method. This method is invoked from both
user API and also from DataSet
when a DATASET is duplicated.tableName
- Temp-table name to be used in subsequent query statements which refer to this
temp-table.beforeName
- The name of the before table name. If null
the BEFORE_TABLE won't be
created.true
on success.boolean createBeforeTable(java.lang.String beforeName)
beforeName
- The name of the before table to be build.true
if operation is successful and false
otherwise.public logical tempTablePrepare(java.lang.String name)
TEMP-TABLE-PREPARE
method of Progress 4GL.name
- Temp-table name to be used in subsequent query statements that refer to this temp-table.true
on success.public logical tempTablePrepare(character name)
TEMP-TABLE-PREPARE
method of Progress 4GL.name
- Temp-table name to be used in subsequent query statements that refer to this temp-table.true
on success.public logical tempTablePrepare(java.lang.String name, boolean before)
TEMP-TABLE-PREPARE
method of Progress 4GL.name
- Temp-table name to be used in subsequent query statements which refer to this temp-table.before
- Create the BEFORE-TABLE
also if true
.true
on success.public logical tempTablePrepare(java.lang.String name, logical before)
TEMP-TABLE-PREPARE
method of Progress 4GL.name
- Temp-table name to be used in subsequent query statements which refer to this temp-table.before
- Create the BEFORE-TABLE
also if true
.true
on success.public logical tempTablePrepare(character name, boolean before)
TEMP-TABLE-PREPARE
method of Progress 4GL.name
- Temp-table name to be used in subsequent query statements which refer to this temp-table.before
- Create the BEFORE-TABLE
also if true
.true
on success.public logical tempTablePrepare(character name, logical before)
TEMP-TABLE-PREPARE
method of Progress 4GL.name
- Temp-table name to be used in subsequent query statements which refer to this temp-table.before
- Create the BEFORE-TABLE
also if true
.true
on success.public logical addFieldsFrom(java.lang.String tableName)
tableName
- The name of the table from which to copy the field definitions.true
for success.public logical addFieldsFrom(handle hbuf)
hbuf
- A handle to a buffer or table from which to copy the field definitions.true
for success.public logical addFieldsFrom(character tableName)
tableName
- The name of the table from which to copy the field definitions.true
for success.public logical addFieldsFrom(handle hbuf, java.lang.String except)
hbuf
- A handle to a buffer or table from which to copy the field definitions.except
- A comma-separated list of field names to be excluded from the copy process.true
for success.public logical addFieldsFrom(java.lang.String tableName, java.lang.String except)
tableName
- The name of the table from which to copy the field definitions.except
- A comma-separated list of field names to be excluded from the copy process.true
for success.public logical addFieldsFrom(java.lang.String tableName, character except)
tableName
- The name of the table from which to copy the field definitions.except
- A comma-separated list of field names to be excluded from the copy process.true
for success.public logical addFieldsFrom(handle hbuf, character except)
hbuf
- A handle to a buffer or table from which to copy the field definitions.except
- A comma-separated list of field names to be excluded from the copy process.true
for success.public logical addFieldsFrom(character tableName, character except)
tableName
- The name of the table from which to copy the field definitions.except
- A comma-separated list of field names to be excluded from the copy process.true
for success.public void createFromTableWrapper(TableWrapper tableWrapper, int tableParameterIndex)
tableWrapper
- Table wrapper containing table definitions.tableParameterIndex
- 1-based index of corresponding TABLE[-HANDLE] parameter (in function declaration).
Used for error handling.public handle defaultBufferHandle()
tempTablePrepare()
method.
This method is the P2J equivalent of DEFAULT-BUFFER-HANDLE
attribute.public void name(character name)
name
in interface Nameable
name
in class HandleChain
name
- New table name.public character name()
name
in interface Nameable
name
in class HandleChain
protected boolean hasPrevSibling()
hasPrevSibling
in class HandleChain
false
.protected boolean hasNextSibling()
hasNextSibling
in class HandleChain
false
.protected boolean hasNameReadOnly()
hasNameReadOnly
in class HandleChain
false
, as NAME attribute is writable.protected boolean hasNameConstraints()
hasNameConstraints
in class HandleChain
false
, requiring that its name should be
validated before assignment.HandleChain.validateName(java.lang.String)
public boolean valid()
true
if we are valid (can be used).protected boolean resourceDelete()
HandleChain.delete()
.resourceDelete
in class HandleResource
true
if the resource was deleted.public void forceDelete()
valid()
calls return false
).public java.util.Collection<P2JField> getFields()
public P2JField getField(java.lang.String fieldName)
fieldName
- Field name.public P2JIndex getIndex(java.lang.String indexName)
indexName
- Index name.public java.util.Collection<P2JIndex> getIndexes()
public DmoMeta getDmoMeta()
DmoMeta
structure which contains the legacy meta information.DmoMeta
structure which contains the legacy meta informationpublic java.lang.Class<? extends DataModelObject> getDMOInterface()
null
if the table is not
initialized yet.public java.lang.Class<? extends TempTableBuffer> getDMOBufInterface()
null
if the table is not
initialized yet.public java.lang.Class<? extends Record> getDMOClass()
null
if the
table is not initialized yet.public void setCodePageSupplier(java.lang.String property, java.util.function.Supplier supplier)
property
- The ORM property name of the CLOB field.supplier
- The code page supplier of the specified CLOB field.public void setCodePage(java.lang.String property, java.lang.String codePage)
property
- The ORM property name of the CLOB field.codePage
- The code page of the specified CLOB field.public java.lang.String getCodePage(java.lang.String property)
property
- The ORM property name of the CLOB field.null
if not configured so the default must
be used.public java.util.function.Supplier getCodePageSupplier(java.lang.String property)
property
- The ORM property name of the CLOB field.null
in this implementation.void setDmoIface(DmoMeta dmoInfo, java.lang.Class<? extends DataModelObject> dmoIface, java.lang.Class<? extends TempTableBuffer> dmoBufIface)
dmoInfo
- Object which contains metadata about the DMO.dmoIface
- DMO interface class which corresponds the table.dmoBufIface
- DMO buffer interface class which corresponds the table.protected boolean addFunctionWasCalled()
addFunctionWasCalled
in class AbstractTempTable
true
if an ADD-* function was called for the table.protected void addNewField(PropertyDefinition propertyDefinition)
propertyDefinition
- Definition of the field to add.private logical createTableLikeImpl(character tableName, character indexName, boolean handleIndex)
CREATE-LIKE
method of Progress 4GL.tableName
- The name of a table to create the copy of.indexName
- The name of a single index which is copied from the source table.handleIndex
- true
if indexName
parameter should be taken into
consideration. This parameter is required because unknown
index name
represents an index with empty name rather than "index not specified" case.true
on success.private logical createTableLikeImpl(handle hbuf, character indexName, boolean handleIndex)
CREATE-LIKE
method
of Progress 4GL.hbuf
- A handle to a buffer or table from which to copy the definitions.indexName
- The name of a single index which is copied from the source table.handleIndex
- true
if indexName
parameter should be taken into
consideration. This parameter is required because unknown
index name
represents an index with empty name rather than "index not specified" case.true
on success.private logical addIndexLike(P2JIndex srcIndex)
ADD-LIKE-FIELD
method of Progress 4GL.srcIndex
- The index in the source table that is being copied to the temp-table.true
on success.private void doAddFieldsFrom(java.util.Collection<P2JField> srcFields, character except)
srcFields
- Set of fields to be added.except
- Comma-separated list of field names that should be excluded from the copy process.private void createDefaultBuffer()
private void displayUnableToPrepareTableFields()
private void displayUnableToPrepareTableIndices()
private void displayUnableToEvaluate()
private void displayCouldNotFindLikeTable(java.lang.String tableName)
tableName
- Table name.private void displayCouldNotFindLikeTableName(java.lang.String tableName)
tableName
- Table name.private void displayDuplicateIndex(java.lang.String indexName)
indexName
- Index name.private void displayCouldNotFindLikeField(java.lang.String fieldName)
fieldName
- Field name.private void displayCouldNotFindLikeIndex(java.lang.String tableName, java.lang.String indexName)
tableName
- Table name.indexName
- Index name.private void displayCouldNotFindAddIndex(java.lang.String indexName)
indexName
- Index name.private void displayUnableToCreateLikeIndex()
private void displayDuplicateOrInvalidIndexField(java.lang.String indexName, java.lang.String fieldName)
indexName
- Index name.fieldName
- Field name.private void displayUnableToFindIndex(java.lang.String tableName, java.lang.String indexName)
tableName
- Table name.indexName
- Index name.private boolean forceClear()
true
if operation was successful.private java.util.Set<java.lang.String> parseFieldList(character list)
list
- Comma-separated list of fields.null
if there are no fields in the
input list. Names are returned in lower case, spaces are kept.private Persistence findExistingTable(java.lang.String fullTableName, boolean tableNameSearch)
fullTableName
- Table name in format "databaseName.tableName" or "tableName". In the latter case
table search is performed in all permanent databases and then the temporary
database. Dynamic tables are ignored.tableNameSearch
- true
if it is called from ADD-LIKE-INDEX, ADD-FIELDS-FROM or
CREATE-LIKE, false
if it is called from ADD-FIELD-LIKE. Affects
error messaging.null
if there is
no such table.private boolean hasSameNormalizedName(java.lang.String name1, java.lang.String name2)
TextOps.rightTrimLower(String)
for more information.name1
- First name to compare.name2
- Second name to compare.true
if two names has the same normalized form.private P2JField copyField(java.lang.String targetName, P2JField srcField)
targetName
- The name of the new field.srcField
- Source field to copy.private P2JIndex copyIndex(P2JIndex srcIndex)
srcIndex
- Source index to copy.public void addField(P2JField field)
Note:
This method was made public in order to be directly accessed from
XmlImport
.
field
- Field to add.private void addIndex(P2JIndex index)
index
- Index to add.private boolean hasField(java.lang.String fieldName)
fieldName
- Field name to check.true
if there is a field which has the same name (in normalized form,
see TextOps.rightTrimLower(String)
).private boolean hasIndex(java.lang.String indexName)
indexName
- Index name to check.true
if there is an index which has the same name (in normalized form,
see TextOps.rightTrimLower(String)
).private void addAllIndexes(java.util.Collection<P2JIndex> indexes)
indexes
- Indexes to add.private void addAllFields(java.util.Collection<P2JField> fields)
fields
- Fields to add.public java.lang.String toString()
toString
in class HandleResource