/** * This will drop the database schemas if managing the database schemas. */ protected void dropSequences() { processSequenceDefinitions(false, false, false); }
/** * This will drop the database schemas if managing the database schemas. */ protected void dropSequences() { processSequenceDefinitions(false, false, false); }
/** * Common implementor for createSequence and replaceSequence, distinguishes between sequence tables and sequence objects * @param createSequenceTables - true to create the sequences tables, false to replace them (dropped then create) * @param createSequences - true to create the sequences objects, false to replace them (dropped then create) */ protected void createOrReplaceSequences(boolean createSequenceTables, boolean createSequences) throws EclipseLinkException { // PERF: Allow a special "fast" flag to be set on the session causes a delete from the table instead of a replace. boolean fast = FAST_TABLE_CREATOR; if (fast) { // Assume sequences already created. return; } processSequenceDefinitions(createSequenceTables, createSequences, true); }
/** * Common implementor for createSequence and replaceSequence, distinguishes between sequence tables and sequence objects * @param createSequenceTables - true to create the sequences tables, false to replace them (dropped then create) * @param createSequences - true to create the sequences objects, false to replace them (dropped then create) */ protected void createOrReplaceSequences(boolean createSequenceTables, boolean createSequences) throws EclipseLinkException { // PERF: Allow a special "fast" flag to be set on the session causes a delete from the table instead of a replace. boolean fast = FAST_TABLE_CREATOR; if (fast) { // Assume sequences already created. return; } processSequenceDefinitions(createSequenceTables, createSequences, true); }
/** * Common implementor for createSequence and replaceSequence, distinguishes between sequence tables and sequence objects * @param createSequenceTables - true to create the sequences tables, false to replace them (dropped then create) * @param createSequenceObjects - true to create the sequences objects, false to replace them (dropped then create) */ protected void createOrReplaceSequences(boolean createSequenceTables, boolean createSequenceObjects) throws EclipseLinkException { // PERF: Allow a special "fast" flag to be set on the session causes a delete from the table instead of a replace. boolean fast = FAST_TABLE_CREATOR; if (fast) { // Assume sequences already created. return; } Sequencing sequencing = getSession().getSequencing(); if ((sequencing == null) || (sequencing.whenShouldAcquireValueForAll() == Sequencing.AFTER_INSERT)) { // Not required on Sybase native etc. return; } // Prepare table and sequence definitions // table name mapped to TableDefinition HashMap tableDefinitions = new HashMap(); // sequence name to SequenceDefinition HashSet sequenceDefinitions = new HashSet(); // remember the processed - to handle each sequence just once. HashSet processedSequenceNames = new HashSet(); buildTableAndSequenceDefinitions(sequenceDefinitions, processedSequenceNames, tableDefinitions); processTableDefinitions(tableDefinitions, createSequenceTables); processSequenceDefinitions(sequenceDefinitions, createSequenceObjects); }