I want to pass a user defined object from my hibernate class and pass it onto a stored procedure which reads this list of objects and does the processing. How can i do the same?
The Class is as follows.
public class ExcelListenerBean {
private int id;
private String shortName;
private String fmrCusip;
private Double incorrectTrdShares;
private Double incorrectTrdPrice;
private String incorrectTrdBuySell;
private Double incorrectTrdCommRate;
private Double incorrectTrdCommission;
private Double incorrectTrdFees;
private Double incorrectTrdNet;
private Double correctionTrdShares;
private Double correctionTrdPrice;
private String correctionTrdBuySell;
private Double correctionTrdCommRate;
private Double correctionTrdCommission;
private Double correctionTrdFees;
private Double correctionTrdNet;
private String currency;
private String fx;
private Double netUSD;
private String notes;
}
Can any one please let me know how to draft the procedure and how to loop through the list of ExcelListenerBean objects and save them to a table.
MyType is OBJECT ....in Oracle that has all the fields you needTableOfMyObject IS TABLE OF MyObjectTypeTableOfMyObjectas parameter.You can use collection variable in SQL statements in your stored procedure like
SELECT * FROM TABLE(collection_variable)I did the same, but the biggest challenge wast to call it from the app using hibernate – I finally found the way to do that.
Update
SQL that can be run from Toad.