use of org.eclipse.persistence.tools.schemaframework.StoredProcedureDefinition in project eclipselink by eclipse-ee4j.
the class EmployeePopulator method buildOracleStoredProcedureReadInOut.
public StoredProcedureDefinition buildOracleStoredProcedureReadInOut(DatabaseSession session) {
StoredProcedureDefinition proc = new StoredProcedureDefinition();
proc.setName("SProc_Read_InOut");
proc.addInOutputArgument("address_id_v", Long.class);
proc.addOutputArgument("street_v", String.class);
String statement = null;
if (session.getPlatform().isSQLServer() || session.getPlatform().isSybase()) {
// 260263: SQLServer 2005/2008 requires parameter matching in the select clause for stored procedures
statement = "SELECT @address_id_v=ADDRESS_ID, @street_v=STREET from MBR1_ADDRESS where (ADDRESS_ID = @address_id_v)";
} else {
statement = "SELECT ADDRESS_ID, STREET into address_id_v, street_v from MBR1_ADDRESS where (ADDRESS_ID = address_id_v)";
}
proc.addStatement(statement);
return proc;
}
use of org.eclipse.persistence.tools.schemaframework.StoredProcedureDefinition in project eclipselink by eclipse-ee4j.
the class EmployeePopulator method buildOracleStoredProcedureReadFromAddress.
public StoredProcedureDefinition buildOracleStoredProcedureReadFromAddress(DatabaseSession session) {
StoredProcedureDefinition proc = new StoredProcedureDefinition();
proc.setName("SProc_Read_BR1_Address");
proc.addInOutputArgument("address_id_v", Integer.class);
proc.addOutputArgument("street_v", String.class);
proc.addOutputArgument("city_v", String.class);
proc.addOutputArgument("country_v", String.class);
proc.addOutputArgument("province_v", String.class);
proc.addOutputArgument("p_code_v", String.class);
String statement = null;
if (session.getPlatform().isSQLServer() || session.getPlatform().isSybase()) {
// 260263: SQLServer 2005/2008 requires parameter matching in the select clause for stored procedures
statement = "SELECT @street_v=STREET, @city_v=CITY, @country_v=COUNTRY, @province_v=PROVINCE, @p_code_v=P_CODE FROM MBR1_ADDRESS WHERE ADDRESS_ID = @address_id_v";
} else {
statement = "SELECT STREET, CITY, COUNTRY, PROVINCE, P_CODE INTO street_v, city_v, country_v, province_v, p_code_v FROM MBR1_ADDRESS WHERE (ADDRESS_ID = address_id_v)";
}
proc.addStatement(statement);
return proc;
}
use of org.eclipse.persistence.tools.schemaframework.StoredProcedureDefinition in project eclipselink by eclipse-ee4j.
the class EmployeePopulator method buildOracleStoredProcedureReadInOut.
public StoredProcedureDefinition buildOracleStoredProcedureReadInOut(DatabaseSession session) {
StoredProcedureDefinition proc = new StoredProcedureDefinition();
proc.setName("SProc_Read_InOut");
proc.addInOutputArgument("address_id_v", Long.class);
proc.addOutputArgument("street_v", String.class);
String statement = null;
if (session.getPlatform().isSQLServer() || session.getPlatform().isSybase()) {
// 260263: SQLServer 2005/2008 requires parameter matching in the select clause for stored procedures
statement = "SELECT @address_id_v=ADDRESS_ID, @street_v=STREET from CMP3_ADDRESS where (ADDRESS_ID = @address_id_v)";
} else {
statement = "SELECT ADDRESS_ID, STREET into address_id_v, street_v from CMP3_ADDRESS where (ADDRESS_ID = address_id_v)";
}
proc.addStatement(statement);
return proc;
}
use of org.eclipse.persistence.tools.schemaframework.StoredProcedureDefinition in project eclipselink by eclipse-ee4j.
the class EmployeePopulator method buildOracleStoredProcedureReadFromAddress.
public StoredProcedureDefinition buildOracleStoredProcedureReadFromAddress(DatabaseSession session) {
StoredProcedureDefinition proc = new StoredProcedureDefinition();
proc.setName("SProc_Read_Address");
proc.addInOutputArgument("address_id_v", Integer.class);
proc.addOutputArgument("street_v", String.class);
proc.addOutputArgument("city_v", String.class);
proc.addOutputArgument("country_v", String.class);
proc.addOutputArgument("province_v", String.class);
proc.addOutputArgument("p_code_v", String.class);
String statement = null;
if (session.getPlatform().isSQLServer() || session.getPlatform().isSybase()) {
// 260263: SQLServer 2005/2008 requires parameter matching in the select clause for stored procedures
statement = "SELECT @street_v=STREET, @city_v=CITY, @country_v=COUNTRY, @province_v=PROVINCE, @p_code_v=P_CODE FROM CMP3_ADDRESS WHERE ADDRESS_ID = @address_id_v";
} else {
statement = "SELECT STREET, CITY, COUNTRY, PROVINCE, P_CODE INTO street_v, city_v, country_v, province_v, p_code_v FROM CMP3_ADDRESS WHERE (ADDRESS_ID = address_id_v)";
}
proc.addStatement(statement);
return proc;
}
use of org.eclipse.persistence.tools.schemaframework.StoredProcedureDefinition in project eclipselink by eclipse-ee4j.
the class EmployeePopulator method buildStoredProcedureReadFromAddressMappedNumbered.
public StoredProcedureDefinition buildStoredProcedureReadFromAddressMappedNumbered(DatabasePlatform platform) {
StoredProcedureDefinition proc = new StoredProcedureDefinition();
proc.setName("XML_Read_Address_Numbered");
proc.addArgument("address_id_v", Integer.class);
String statement = null;
if (platform.isSQLServer() || platform.isSybase()) {
// 260263: SQLServer 2005/2008 requires parameter matching in the select clause for stored procedures
statement = "SELECT ADDRESS_ID AS '1', STREET AS '2', CITY AS '3', COUNTRY AS '4', PROVINCE AS '5', P_CODE AS '6' FROM JPA21_XML_ADDRESS WHERE ADDRESS_ID = @ADDRESS_ID_V";
} else {
statement = "SELECT ADDRESS_ID AS '1', STREET AS '2', CITY AS '3', COUNTRY AS '4', PROVINCE AS '5', P_CODE AS '6' FROM JPA21_XML_ADDRESS WHERE (ADDRESS_ID = address_id_v)";
}
proc.addStatement(statement);
return proc;
}
Aggregations