/** * INTERNAL: * Return the correct call type for the native query string. * This allows EIS platforms to use different types of native calls. */ public DatasourceCall buildNativeCall(String queryString) { return new SQLCall(queryString); } }
/** * INTERNAL: * Return the correct call type for the native query string. * This allows EIS platforms to use different types of native calls. */ public DatasourceCall buildNativeCall(String queryString) { return new SQLCall(queryString); }
/** * PUBLIC: * Execute the sql on the database. * <p>Example: * <p>session.executeNonSelectingSQL("Delete from Employee"); * @see #executeNonSelectingCall(Call) * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. */ public void executeNonSelectingSQL(String sqlString) throws DatabaseException { executeNonSelectingCall(new SQLCall(sqlString)); }
/** * PUBLIC: * Execute the sql on the database. * <p>Example: * <p>session.executeNonSelectingSQL("Delete from Employee"); * @see #executeNonSelectingCall(Call) * Warning: Allowing an unverified SQL string to be passed into this * method makes your application vulnerable to SQL injection attacks. */ public void executeNonSelectingSQL(String sqlString) throws DatabaseException { executeNonSelectingCall(new SQLCall(sqlString)); }
/** * INTERNAL: * Execute the SQL alter table to add the field to the table. */ public void addFieldOnDatabase(final AbstractSession session, FieldDefinition field){ session.priviledgedExecuteNonSelectingCall( new SQLCall( buildAddFieldWriter(session, field, new StringWriter()).toString() ) ); }
/** * INTERNAL: * Execute the DDL to create the database schema for this object. */ @Override public void createDatabaseSchemaOnDatabase(AbstractSession session, Set<String> createdDatabaseSchemas) throws EclipseLinkException { session.priviledgedExecuteNonSelectingCall(new SQLCall(buildDatabaseSchemaCreationWriter(session, new StringWriter(), createdDatabaseSchemas).toString())); }
/** * INTERNAL: * Execute the SQL alter table to add the field to the table. */ public void addFieldOnDatabase(final AbstractSession session, FieldDefinition field){ session.priviledgedExecuteNonSelectingCall( new SQLCall( buildAddFieldWriter(session, field, new StringWriter()).toString() ) ); }
/** * INTERNAL: * Execute the DDL to drop the database schema for this object. */ @Override public void dropDatabaseSchemaOnDatabase(AbstractSession session) throws EclipseLinkException { session.priviledgedExecuteNonSelectingCall(new SQLCall(buildDatabaseSchemaDeletionWriter(session, new StringWriter()).toString())); }
/** * INTERNAL: * Execute the SQL required to alter sequence increment. * Assume that the sequence exists. */ public void alterOnDatabase(AbstractSession session) throws EclipseLinkException { // Bug# 242120: Let the DatabaseException propagate and do not call // createOnDatabase(session) which would cause an infinite loop on a JTA connection session.priviledgedExecuteNonSelectingCall(new SQLCall(buildAlterIncrementWriter(session, new StringWriter()).toString())); }
/** * INTERNAL: * Execute the DDL to create this object. */ public void createOnDatabase(AbstractSession session) throws EclipseLinkException { session.executeNonSelectingCall(new SQLCall(buildCreationWriter(session, new StringWriter()).toString())); }
/** * INTERNAL: * Execute the SQL required to alter sequence increment. * Assume that the sequence exists. */ public void alterOnDatabase(AbstractSession session) throws EclipseLinkException { // Bug# 242120: Let the DatabaseException propagate and do not call // createOnDatabase(session) which would cause an infinite loop on a JTA connection session.executeNonSelectingCall(new SQLCall(buildAlterIncrementWriter(session, new StringWriter()).toString())); }
/** * INTERNAL: * Execute the DDL to create this object. */ public void createOnDatabase(AbstractSession session) throws EclipseLinkException { session.priviledgedExecuteNonSelectingCall(new SQLCall(buildCreationWriter(session, new StringWriter()).toString())); if (shouldCreateVPDCalls(session)) { session.priviledgedExecuteNonSelectingCall(new SQLCall(buildVPDCreationPolicyWriter(session, new StringWriter()).toString())); session.priviledgedExecuteNonSelectingCall(new SQLCall(buildVPDCreationFunctionWriter(session, new StringWriter()).toString())); } }
/** * INTERNAL: * Execute the DDL to create this object. */ public void createOnDatabase(AbstractSession session) throws EclipseLinkException { session.priviledgedExecuteNonSelectingCall(new SQLCall(buildCreationWriter(session, new StringWriter()).toString())); if (shouldCreateVPDCalls(session)) { session.priviledgedExecuteNonSelectingCall(new SQLCall(buildVPDCreationPolicyWriter(session, new StringWriter()).toString())); session.priviledgedExecuteNonSelectingCall(new SQLCall(buildVPDCreationFunctionWriter(session, new StringWriter()).toString())); } }
/** * INTERNAL: * Execute the DDL to drop the object. */ public void dropFromDatabase(AbstractSession session) throws EclipseLinkException { session.priviledgedExecuteNonSelectingCall(new SQLCall(buildDeletionWriter(session, new StringWriter()).toString())); if (shouldCreateVPDCalls(session)) { session.priviledgedExecuteNonSelectingCall(new SQLCall(buildVPDDeletionWriter(session, new StringWriter()).toString())); } }
/** * INTERAL: * Verify whether the sequence exists. * Assume that the unary sequence table exists. */ public boolean checkIfExist(AbstractSession session) throws DatabaseException { Vector results = session.priviledgedExecuteSelectingCall(new org.eclipse.persistence.queries.SQLCall("SELECT * FROM " + getName())); return !results.isEmpty(); }
/** * {@inheritDoc} */ @Override public void initializeCall(XRServiceAdapter xrService, QueryOperation queryOperation, DatabaseQuery databaseQuery) { databaseQuery.setCall(new SQLCall(getSqlString())); } }
/** * {@inheritDoc} */ @Override public void initializeCall(XRServiceAdapter xrService, QueryOperation queryOperation, DatabaseQuery databaseQuery) { databaseQuery.setCall(new SQLCall(getSqlString())); } }
void createForeignConstraintsOnDatabase(final AbstractSession session) throws ValidationException, DatabaseException { if ((!session.getPlatform().supportsForeignKeyConstraints()) || getForeignKeyMap().isEmpty()) { return; } for (ForeignKeyConstraint foreignKey : getForeignKeyMap().values()) { session.executeNonSelectingCall(new SQLCall(buildConstraintCreationWriter(session, foreignKey, new StringWriter()).toString())); } }
private void dropForeignConstraintsOnDatabase(final AbstractSession session) throws ValidationException { if ((!session.getPlatform().supportsForeignKeyConstraints()) || getForeignKeyMap().isEmpty()) { return; } for (ForeignKeyConstraint foreignKey : getForeignKeyMap().values()) { try { session.executeNonSelectingCall(new SQLCall(buildConstraintDeletionWriter(session, foreignKey, new StringWriter()).toString())); } catch (DatabaseException ex) {/* ignore */ } } }
void createForeignConstraintsOnDatabase(final AbstractSession session) throws ValidationException, DatabaseException { if ((!session.getPlatform().supportsForeignKeyConstraints()) || getForeignKeyMap().isEmpty()) { return; } for (ForeignKeyConstraint foreignKey : getForeignKeyMap().values()) { if (! foreignKey.disableForeignKey()) { session.priviledgedExecuteNonSelectingCall(new SQLCall(buildConstraintCreationWriter(session, foreignKey, new StringWriter()).toString())); } } }