HI All,
I chosed storedProcedure which is execute database side (to get speed) but I have big problem when I execute it.
in my seach Class :
private static final String PROCEDURE_NAME = "searchEtudiants";
public static NSMutableDictionary parameters(String pperiode,
String pdiplome, String pniveau, String puv, String pnom,
String pprenom, Number pnum, Long pconseiller) {
NSMutableDictionary<String, Object> bindings = new NSMutableDictionary<String, Object>();
bindings.takeValueForKey(pperiode, "010_pperiode");
bindings.takeValueForKey(pdiplome, "020_pdiplome");
bindings.takeValueForKey(pniveau, "030_pniveau");
bindings.takeValueForKey(puv, "040_puv");
bindings.takeValueForKey(pnom, "050_pnom");
bindings.takeValueForKey(pprenom, "060_pprenom");
bindings.takeValueForKey(pnum, "070_pnum");
bindings.takeValueForKey(pconseiller, "080_pconseiller");
bindings.takeValueForKey(null, "090_etu_cur");
return bindings;
}
etudiantList = EOUtilities.executeStoredProcedureNamed(ed,PROCEDURE_NAME,parameters(periode, diplome, niveau, uv, nom,prenom, nombre, null));
etudiantList is a NSDictionary
StoredProcedures Information
<EOStoredProcedure searchEtudiants
arguments : '({columnName = "010_pperiode"; className = "java.lang.String"; externalType = "VARCHAR2"; parameterDirection = "1"; allowsNull = "Y"; name = "010_pperiode"; }, {columnName = "020_pdiplome"; className = "java.lang.String"; externalType = "VARCHAR2"; parameterDirection = "1"; allowsNull = "Y"; name = "020_pdiplome"; }, {columnName = "030_pniveau"; className = "java.lang.String"; externalType = "VARCHAR2"; parameterDirection = "1"; allowsNull = "Y"; name = "030_pniveau"; }, {columnName = "040_puv"; className = "java.lang.String"; externalType = "VARCHAR2"; parameterDirection = "1"; allowsNull = "Y"; name = "040_puv"; }, {columnName = "050_pnom"; className = "java.lang.String"; externalType = "VARCHAR2"; parameterDirection = "1"; allowsNull = "Y"; name = "050_pnom"; }, {columnName = "060_pprenom"; className = "java.lang.String"; externalType = "VARCHAR2"; parameterDirection = "1"; allowsNull = "Y"; name = "060_pprenom"; }, {valueType = "i"; columnName = "070_pnum"; className = "java.lang.Number"; externalType = "NUMBER"; parameterDirection = "1"; allowsNull = "Y"; name = "070_pnum"; }, {valueType = "i"; columnName = "080_pconseiller"; className = "java.lang.Number"; externalType = "NUMBER"; parameterDirection = "1"; allowsNull = "Y"; name = "080_pconseiller"; }, {columnName = "090_etu_cur"; className = "com.webobjects.foundation.NSData"; parameterDirection = "2"; allowsNull = "Y"; name = "090_etu_cur"; })'
name : 'searchEtudiants'
externalName : 'GERRY.PROFIL_ETUDIANTS.SEARCH_ETUDIANTS'
>
parameters can have null value (allowsNull = "Y") and it's considered in my sotredProcedure and tested (so problem)
1 : Parameters are null
283554 [WorkerThread0] DEBUG NSLog - executeStoredProcedure: searchEtudiants withValues:{}
283556 [WorkerThread0] DEBUG NSLog - === Begin Internal Transaction
283557 [WorkerThread0] DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.OraclePlugIn$OracleExpression: "{ call GERRY.PROFIL_ETUDIANTS.SEARCH_ETUDIANTS (?, ?, ?, ?, ?, ?, ?, ?, ?)}" withBindings: 1:<com.webobjects.foundation.NSKeyValueCoding$Null>(010_pperiode), 2:<com.webobjects.foundation.NSKeyValueCoding$Null>(020_pdiplome), 3:<com.webobjects.foundation.NSKeyValueCoding$Null>(030_pniveau), 4:<com.webobjects.foundation.NSKeyValueCoding$Null>(040_puv), 5:<com.webobjects.foundation.NSKeyValueCoding$Null>(050_pnom), 6:<com.webobjects.foundation.NSKeyValueCoding$Null>(060_pprenom), 7:<com.webobjects.foundation.NSKeyValueCoding$Null>(070_pnum), 8:<com.webobjects.foundation.NSKeyValueCoding$Null>(080_pconseiller), 9:<com.webobjects.foundation.NSKeyValueCoding$Null>(090_etu_cur)>
Exception : java.lang.NullPointerException
2 : parameters have nom, prenom, numero and conseiller *null*
247225 [WorkerThread0] DEBUG NSLog - executeStoredProcedure: searchEtudiants withValues:{030_pniveau = "783 -M2"; 010_pperiode = "20101A"; 040_puv = "10803"; 020_pdiplome = "MST"; }
247228 [WorkerThread0] DEBUG NSLog - === Begin Internal Transaction
247229 [WorkerThread0] DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.OraclePlugIn$OracleExpression: "{ call GERRY.PROFIL_ETUDIANTS.SEARCH_ETUDIANTS (?, ?, ?, ?, ?, ?, ?, ?, ?)}" withBindings: 1:"20101A"(010_pperiode), 2:"MST"(020_pdiplome), 3:"783 -M2"(030_pniveau), 4:"10803"(040_puv), 5:<com.webobjects.foundation.NSKeyValueCoding$Null>(050_pnom), 6:<com.webobjects.foundation.NSKeyValueCoding$Null>(060_pprenom), 7:<com.webobjects.foundation.NSKeyValueCoding$Null>(070_pnum), 8:<com.webobjects.foundation.NSKeyValueCoding$Null>(080_pconseiller), 9:<com.webobjects.foundation.NSKeyValueCoding$Null>(090_etu_cur)>
Exception : java.lang.NullPointerException
3 : Parameters have conseiller *null*
136288 [WorkerThread1] DEBUG NSLog - executeStoredProcedure: searchEtudiants withValues:{050_pnom = hide; 070_pnum = 11369; 010_pperiode = "20101A"; 060_pprenom = "Samira"; 020_pdiplome = "MST"; 030_pniveau = "78378322"; 040_puv = "11220"; }
136291 [WorkerThread1] DEBUG NSLog - === Begin Internal Transaction
136292 [WorkerThread1] DEBUG NSLog - evaluateExpression: <com.webobjects.jdbcadaptor.OraclePlugIn$OracleExpression: "{ call GERRY.PROFIL_ETUDIANTS.SEARCH_ETUDIANTS (?, ?, ?, ?, ?, ?, ?, ?, ?)}" withBindings: 1:"20101A"(010_pperiode), 2:"MST"(020_pdiplome), 3:"78378322"(030_pniveau), 4:"11220"(040_puv), 5:"AOUES"(050_pnom), 6:"Samira"(060_pprenom), 7:11369(070_pnum), 8:<com.webobjects.foundation.NSKeyValueCoding$Null>(080_pconseiller), 9:<com.webobjects.foundation.NSKeyValueCoding$Null>(090_etu_cur)>
143130 [WorkerThread1] INFO er.transaction.adaptor.Exceptions - Database Exception occured: java.lang.NullPointerException
I still have the same error regardless of parameters. What's wrong?
PS : How to cast etudiantList as Entity?
Thnaks for your help