Search in sources :

Example 6 with DataModifyQuery

use of org.eclipse.persistence.queries.DataModifyQuery in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildEmployeeInQuery.

protected DatabaseQuery buildEmployeeInQuery() {
    PLSQLrecord record = buildEmployeeRecord();
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_P.PLSQL_EMP_IN");
    call.addNamedArgument("P_EMP", record);
    call.addNamedArgument("P_CITY", JDBCTypes.VARCHAR_TYPE);
    DataModifyQuery query = new DataModifyQuery();
    query.addArgument("P_EMP", Employee.class);
    query.addArgument("P_CITY", String.class);
    query.setCall(call);
    return query;
}
Also used : PLSQLStoredProcedureCall(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall) PLSQLrecord(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord) DataModifyQuery(org.eclipse.persistence.queries.DataModifyQuery)

Example 7 with DataModifyQuery

use of org.eclipse.persistence.queries.DataModifyQuery in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildCityListInQuery.

protected DatabaseQuery buildCityListInQuery() {
    PLSQLCollection collection = new PLSQLCollection();
    collection.setTypeName("PLSQL_P.PLSQL_CITY_LIST");
    collection.setCompatibleType("PLSQL_P_PLSQL_CITY_LIST");
    collection.setNestedType(JDBCTypes.VARCHAR_TYPE);
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_P.PLSQL_CITY_LIST_IN");
    call.addNamedArgument("P_CITY_LIST", collection);
    call.addNamedArgument("P_CITY", JDBCTypes.VARCHAR_TYPE);
    DataModifyQuery query = new DataModifyQuery();
    query.addArgument("P_CITY_LIST", java.sql.Array.class);
    query.addArgument("P_CITY", String.class);
    query.setCall(call);
    return query;
}
Also used : PLSQLStoredProcedureCall(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall) PLSQLCollection(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLCollection) DataModifyQuery(org.eclipse.persistence.queries.DataModifyQuery)

Example 8 with DataModifyQuery

use of org.eclipse.persistence.queries.DataModifyQuery in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildSimpleInFuncQuery.

protected DatabaseQuery buildSimpleInFuncQuery() {
    PLSQLStoredFunctionCall call = new PLSQLStoredFunctionCall(OraclePLSQLTypes.PLSQLBoolean);
    call.setProcedureName("PLSQL_SIMPLE_IN_Func");
    call.addNamedArgument("P_VARCHAR", JDBCTypes.VARCHAR_TYPE, 30);
    call.addNamedArgument("P_BOOLEAN", OraclePLSQLTypes.PLSQLBoolean);
    call.addNamedArgument("P_BINARY_INTEGER", OraclePLSQLTypes.BinaryInteger);
    call.addNamedArgument("P_DEC", OraclePLSQLTypes.Dec);
    call.addNamedArgument("P_INT", OraclePLSQLTypes.Int);
    call.addNamedArgument("P_NATURAL", OraclePLSQLTypes.Natural);
    call.addNamedArgument("P_NATURALN", OraclePLSQLTypes.NaturalN);
    call.addNamedArgument("P_PLS_INTEGER", OraclePLSQLTypes.PLSQLInteger);
    call.addNamedArgument("P_POSITIVE", OraclePLSQLTypes.Positive);
    call.addNamedArgument("P_POSITIVEN", OraclePLSQLTypes.PositiveN);
    call.addNamedArgument("P_SIGNTYPE", OraclePLSQLTypes.SignType);
    call.addNamedArgument("P_NUMBER", JDBCTypes.NUMERIC_TYPE, 10, 2);
    DataModifyQuery query = new DataModifyQuery();
    query.addArgument("P_VARCHAR", String.class);
    query.addArgument("P_BOOLEAN", Integer.class);
    query.addArgument("P_BINARY_INTEGER", Integer.class);
    query.addArgument("P_DEC", Integer.class);
    query.addArgument("P_INT", Integer.class);
    query.addArgument("P_NATURAL", Integer.class);
    query.addArgument("P_NATURALN", Integer.class);
    query.addArgument("P_PLS_INTEGER", Integer.class);
    query.addArgument("P_POSITIVE", Integer.class);
    query.addArgument("P_POSITIVEN", Integer.class);
    query.addArgument("P_SIGNTYPE", BigDecimal.class);
    query.addArgument("P_NUMBER", BigDecimal.class);
    query.setCall(call);
    return query;
}
Also used : PLSQLStoredFunctionCall(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredFunctionCall) DataModifyQuery(org.eclipse.persistence.queries.DataModifyQuery)

Example 9 with DataModifyQuery

use of org.eclipse.persistence.queries.DataModifyQuery in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildSimpleInOutQuery.

protected DatabaseQuery buildSimpleInOutQuery() {
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_SIMPLE_INOUT");
    call.addNamedInOutputArgument("P_VARCHAR", JDBCTypes.VARCHAR_TYPE, 30);
    call.addNamedInOutputArgument("P_BOOLEAN", OraclePLSQLTypes.PLSQLBoolean);
    call.addNamedInOutputArgument("P_BINARY_INTEGER", OraclePLSQLTypes.BinaryInteger);
    call.addNamedInOutputArgument("P_DEC", OraclePLSQLTypes.Dec);
    call.addNamedInOutputArgument("P_INT", OraclePLSQLTypes.Int);
    call.addNamedInOutputArgument("P_NATURAL", OraclePLSQLTypes.Natural);
    call.addNamedInOutputArgument("P_NATURALN", OraclePLSQLTypes.NaturalN);
    call.addNamedInOutputArgument("P_PLS_INTEGER", OraclePLSQLTypes.PLSQLInteger);
    call.addNamedInOutputArgument("P_POSITIVE", OraclePLSQLTypes.Positive);
    call.addNamedInOutputArgument("P_POSITIVEN", OraclePLSQLTypes.PositiveN);
    call.addNamedInOutputArgument("P_SIGNTYPE", OraclePLSQLTypes.SignType);
    call.addNamedInOutputArgument("P_NUMBER", JDBCTypes.NUMERIC_TYPE, 10, 2);
    DataModifyQuery query = new DataModifyQuery();
    query.addArgument("P_VARCHAR", String.class);
    query.addArgument("P_BOOLEAN", Integer.class);
    query.addArgument("P_BINARY_INTEGER", Integer.class);
    query.addArgument("P_DEC", Integer.class);
    query.addArgument("P_INT", Integer.class);
    query.addArgument("P_NATURAL", Integer.class);
    query.addArgument("P_NATURALN", Integer.class);
    query.addArgument("P_PLS_INTEGER", Integer.class);
    query.addArgument("P_POSITIVE", Integer.class);
    query.addArgument("P_POSITIVEN", Integer.class);
    query.addArgument("P_SIGNTYPE", BigDecimal.class);
    query.addArgument("P_NUMBER", BigDecimal.class);
    query.setCall(call);
    return query;
}
Also used : PLSQLStoredProcedureCall(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall) DataModifyQuery(org.eclipse.persistence.queries.DataModifyQuery)

Example 10 with DataModifyQuery

use of org.eclipse.persistence.queries.DataModifyQuery in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildSimpleInQuery.

protected DatabaseQuery buildSimpleInQuery() {
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_SIMPLE_IN");
    call.addNamedArgument("P_VARCHAR", JDBCTypes.VARCHAR_TYPE, 30);
    call.addNamedArgument("P_BOOLEAN", OraclePLSQLTypes.PLSQLBoolean);
    call.addNamedArgument("P_BINARY_INTEGER", OraclePLSQLTypes.BinaryInteger);
    call.addNamedArgument("P_DEC", OraclePLSQLTypes.Dec);
    call.addNamedArgument("P_INT", OraclePLSQLTypes.Int);
    call.addNamedArgument("P_NATURAL", OraclePLSQLTypes.Natural);
    call.addNamedArgument("P_NATURALN", OraclePLSQLTypes.NaturalN);
    call.addNamedArgument("P_PLS_INTEGER", OraclePLSQLTypes.PLSQLInteger);
    call.addNamedArgument("P_POSITIVE", OraclePLSQLTypes.Positive);
    call.addNamedArgument("P_POSITIVEN", OraclePLSQLTypes.PositiveN);
    call.addNamedArgument("P_SIGNTYPE", OraclePLSQLTypes.SignType);
    call.addNamedArgument("P_NUMBER", JDBCTypes.NUMERIC_TYPE, 10, 2);
    DataModifyQuery query = new DataModifyQuery();
    query.addArgument("P_VARCHAR", String.class);
    query.addArgument("P_BOOLEAN", Integer.class);
    query.addArgument("P_BINARY_INTEGER", Integer.class);
    query.addArgument("P_DEC", Integer.class);
    query.addArgument("P_INT", Integer.class);
    query.addArgument("P_NATURAL", Integer.class);
    query.addArgument("P_NATURALN", Integer.class);
    query.addArgument("P_PLS_INTEGER", Integer.class);
    query.addArgument("P_POSITIVE", Integer.class);
    query.addArgument("P_POSITIVEN", Integer.class);
    query.addArgument("P_SIGNTYPE", BigDecimal.class);
    query.addArgument("P_NUMBER", BigDecimal.class);
    query.setCall(call);
    return query;
}
Also used : PLSQLStoredProcedureCall(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall) DataModifyQuery(org.eclipse.persistence.queries.DataModifyQuery)

Aggregations

DataModifyQuery (org.eclipse.persistence.queries.DataModifyQuery)72 PLSQLStoredProcedureCall (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall)32 Test (org.junit.Test)24 StringReader (java.io.StringReader)23 Project (org.eclipse.persistence.sessions.Project)22 ObjectPersistenceWorkbenchXMLProject (org.eclipse.persistence.internal.sessions.factories.ObjectPersistenceWorkbenchXMLProject)21 XMLContext (org.eclipse.persistence.oxm.XMLContext)21 XMLMarshaller (org.eclipse.persistence.oxm.XMLMarshaller)21 Document (org.w3c.dom.Document)21 NonJDBCTestHelper.buildTestProject (org.eclipse.persistence.testing.tests.nonJDBC.NonJDBCTestHelper.buildTestProject)17 NonJDBCTestHelper.buildWorkbenchXMLProject (org.eclipse.persistence.testing.tests.nonJDBC.NonJDBCTestHelper.buildWorkbenchXMLProject)17 AbstractRecord (org.eclipse.persistence.internal.sessions.AbstractRecord)12 DatabaseField (org.eclipse.persistence.internal.helper.DatabaseField)10 PLSQLrecord (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord)8 DatabaseRecord (org.eclipse.persistence.sessions.DatabaseRecord)7 Expression (org.eclipse.persistence.expressions.Expression)5 SQLUpdateStatement (org.eclipse.persistence.internal.expressions.SQLUpdateStatement)5 ExpressionBuilder (org.eclipse.persistence.expressions.ExpressionBuilder)4 DatabaseTable (org.eclipse.persistence.internal.helper.DatabaseTable)4 AbstractSession (org.eclipse.persistence.internal.sessions.AbstractSession)4