Search in sources :

Example 11 with PLSQLStoredProcedureCall

use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildSimpleInDefaults2Query.

protected DatabaseQuery buildSimpleInDefaults2Query() {
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_SIMPLE_IN_DEFAULTS");
    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);
    call.addOptionalArgument("P_VARCHAR");
    call.addOptionalArgument("P_BOOLEAN");
    call.addOptionalArgument("P_BINARY_INTEGER");
    call.addOptionalArgument("P_DEC");
    call.addOptionalArgument("P_INT");
    call.addOptionalArgument("P_NATURAL");
    call.addOptionalArgument("P_NATURALN");
    call.addOptionalArgument("P_PLS_INTEGER");
    call.addOptionalArgument("P_POSITIVE");
    call.addOptionalArgument("P_POSITIVEN");
    call.addOptionalArgument("P_SIGNTYPE");
    call.addOptionalArgument("P_NUMBER");
    DataModifyQuery query = new DataModifyQuery();
    query.addArgument("P_VARCHAR", String.class, true);
    query.addArgument("P_BOOLEAN", Integer.class, true);
    query.addArgument("P_BINARY_INTEGER", Integer.class, true);
    query.addArgument("P_DEC", Integer.class, true);
    query.addArgument("P_INT", Integer.class, true);
    query.addArgument("P_NATURAL", Integer.class, true);
    query.addArgument("P_NATURALN", Integer.class, true);
    query.addArgument("P_PLS_INTEGER", Integer.class, true);
    query.addArgument("P_POSITIVE", Integer.class, true);
    query.addArgument("P_POSITIVEN", Integer.class, true);
    query.addArgument("P_SIGNTYPE", BigDecimal.class, true);
    query.addArgument("P_NUMBER", BigDecimal.class, true);
    query.setCall(call);
    return query;
}
Also used : PLSQLStoredProcedureCall(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall) DataModifyQuery(org.eclipse.persistence.queries.DataModifyQuery)

Example 12 with PLSQLStoredProcedureCall

use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildAddressInObjectQuery.

protected DatabaseQuery buildAddressInObjectQuery() {
    PLSQLrecord record = buildAddressRowTypeRecord();
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_ADDRESS_IN");
    call.addNamedArgument("P_ADDRESS", record);
    DataModifyQuery query = new DataModifyQuery();
    query.addArgument("P_ADDRESS", Address.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 13 with PLSQLStoredProcedureCall

use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildEmployeeOutQuery.

protected DatabaseQuery buildEmployeeOutQuery() {
    PLSQLrecord record = buildEmployeeRecord();
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_P.PLSQL_EMP_OUT");
    call.addNamedOutputArgument("P_EMP", record);
    call.addNamedOutputArgument("P_CITY", JDBCTypes.VARCHAR_TYPE);
    DataReadQuery query = new DataReadQuery();
    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) DataReadQuery(org.eclipse.persistence.queries.DataReadQuery)

Example 14 with PLSQLStoredProcedureCall

use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildSimpleOutQuery.

protected DatabaseQuery buildSimpleOutQuery() {
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_SIMPLE_OUT");
    call.addNamedOutputArgument("P_VARCHAR", JDBCTypes.VARCHAR_TYPE, 30);
    call.addNamedOutputArgument("P_BOOLEAN", OraclePLSQLTypes.PLSQLBoolean);
    call.addNamedOutputArgument("P_BINARY_INTEGER", OraclePLSQLTypes.BinaryInteger);
    call.addNamedOutputArgument("P_DEC", OraclePLSQLTypes.Dec);
    call.addNamedOutputArgument("P_INT", OraclePLSQLTypes.Int);
    call.addNamedOutputArgument("P_NATURAL", OraclePLSQLTypes.Natural);
    // TODO: NATURALN not working for outputs, get conversion error?
    // call.addNamedOutputArgument("P_NATURALN", OraclePLSQLTypes.NaturalN);
    call.addNamedOutputArgument("P_PLS_INTEGER", OraclePLSQLTypes.PLSQLInteger);
    call.addNamedOutputArgument("P_POSITIVE", OraclePLSQLTypes.Positive);
    // call.addNamedOutputArgument("P_POSITIVEN", OraclePLSQLTypes.PositiveN);
    call.addNamedOutputArgument("P_SIGNTYPE", OraclePLSQLTypes.SignType);
    call.addNamedOutputArgument("P_NUMBER", JDBCTypes.NUMERIC_TYPE, 10, 2);
    DataModifyQuery query = new DataModifyQuery();
    query.setCall(call);
    return query;
}
Also used : PLSQLStoredProcedureCall(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall) DataModifyQuery(org.eclipse.persistence.queries.DataModifyQuery)

Example 15 with PLSQLStoredProcedureCall

use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildEmployeeListInOutQuery.

protected DatabaseQuery buildEmployeeListInOutQuery() {
    PLSQLrecord record = buildEmployeeRecord();
    PLSQLCollection collection = new PLSQLCollection();
    collection.setTypeName("PLSQL_P.PLSQL_EMP_LIST");
    collection.setCompatibleType("PLSQL_P_PLSQL_EMP_LIST");
    collection.setNestedType(record);
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_P.PLSQL_EMP_LIST_INOUT");
    call.addNamedInOutputArgument("P_EMP_LIST", collection);
    call.addNamedInOutputArgument("P_CITY", JDBCTypes.VARCHAR_TYPE);
    DataReadQuery query = new DataReadQuery();
    query.addArgument("P_EMP_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) PLSQLrecord(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord) DataReadQuery(org.eclipse.persistence.queries.DataReadQuery)

Aggregations

PLSQLStoredProcedureCall (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall)67 ObjectPersistenceWorkbenchXMLProject (org.eclipse.persistence.internal.sessions.factories.ObjectPersistenceWorkbenchXMLProject)37 Project (org.eclipse.persistence.sessions.Project)37 StringReader (java.io.StringReader)36 XMLContext (org.eclipse.persistence.oxm.XMLContext)36 XMLMarshaller (org.eclipse.persistence.oxm.XMLMarshaller)36 Test (org.junit.Test)36 Document (org.w3c.dom.Document)36 DataModifyQuery (org.eclipse.persistence.queries.DataModifyQuery)32 NonJDBCTestHelper.buildTestProject (org.eclipse.persistence.testing.tests.nonJDBC.NonJDBCTestHelper.buildTestProject)30 NonJDBCTestHelper.buildWorkbenchXMLProject (org.eclipse.persistence.testing.tests.nonJDBC.NonJDBCTestHelper.buildWorkbenchXMLProject)30 DataReadQuery (org.eclipse.persistence.queries.DataReadQuery)28 PLSQLrecord (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord)24 PLSQLCollection (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLCollection)12 PLSQLrecordTestHelper.buildTestProject (org.eclipse.persistence.testing.tests.plsqlrecord.PLSQLrecordTestHelper.buildTestProject)6 PLSQLrecordTestHelper.buildWorkbenchXMLProject (org.eclipse.persistence.testing.tests.plsqlrecord.PLSQLrecordTestHelper.buildWorkbenchXMLProject)6 PLSQLargument (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLargument)3 ReadObjectQuery (org.eclipse.persistence.queries.ReadObjectQuery)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2