Still having a little trouble with this, what method would I use to run a stored procedure? Here is my hbm file:
Code:
<hibernate-mapping package="com.nationsholding.xOps.common.model.StoredProcedures">
<class name="OrderCreate">
<id name="id" type="long">
<generator class="native"/>
</id>
<property name="message" type="java.lang.String"/>
<property name="executerEntityId" type="java.lang.String" />
<property name="executerEntityHierarchyId" type="java.lang.String" />
<property name="executerCompanyId" type="java.lang.String"/>
<property name="orderId" type="java.lang.String"/>
<property name="idOrderType" type="java.lang.String" />
<property name="idOrderOrigination" type="java.lang.String" />
<property name="entityIdCustomer" type="java.lang.String" />
<property name="entityIdVendor" type="java.lang.String" />
<property name="requestSubject" type="java.lang.String" />
<property name="requestDescription" type="java.lang.String" />
<property name="address1" type="java.lang.String" />
<property name="address2" type="java.lang.String" />
<property name="city" type="java.lang.String" />
<property name="state" type="java.lang.String" />
<property name="zip" type="java.lang.String" />
<property name="zip4" type="java.lang.String" />
<property name="valid" type="java.lang.Short" />
<property name="latitude" type="java.lang.Long" />
<property name="longitude" type="java.lang.Long" />
<property name="referenceNumber" type="java.lang.String" />
<property name="parcelNumber" type="java.lang.String" />
<property name="entityIdSource" type="java.lang.String" />
<property name="referenceNumberSource" type="java.lang.String" />
<property name="dateTimeReceived" type="java.sql.Timestamp" />
<property name="idOrderPriority" type="java.lang.String" />
<property name="orderNumber" type="java.lang.String" />
<sql-insert callable="true">{call p_order_create (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}</sql-insert>
</class>
</hibernate-mapping>
This is the POJO class for this mapping:
Code:
public class OrderCreate
implements Serializable, XOpsOrder
{
/** The cached hash code value for this instance. Settting to 0 triggers re-calculation. */
private int hashValue = 0;
/** The composite primary key value. */
private Long id;
private String message;
private String orderId;
private String executerEntityId;
private String executerEntityHierarchyId;
private String executerCompanyId;
private String idOrderType;
private String idOrderOrigination;
private String entityIdCustomer;
private String entityIdVendor;
private String requestSubject;
private String requestDescription;
private String address1;
private String address2;
private String city;
private String state;
private String zip;
private String zip4;
private Short valid;
private Long latitude;
private Long longitude;
private String referenceNumber;
private String parcelNumber;
private String entityIdSource;
private String referenceNumberSource;
private Timestamp dateTimeReceived;
private String idOrderPriority;
private String orderNumber;
public OrderCreate()
{
}
/**
* Constructor of Site instances given a simple primary key.
* @param siteId
*/
public OrderCreate(java.lang.Long id)
{
this.setId(id);
}
public java.lang.Long getId()
{
return id;
}
/**
* Set the simple primary key value that identifies this object.
* @param siteId
*/
public void setId(java.lang.Long id)
{
this.hashValue = 0;
this.id = id;
}
/**
* @return Returns the message.
*/
public String getMessage() {
return message;
}
/**
* @param message The message to set.
*/
public void setMessage(String message) {
this.message = message;
}
/**
* @return Returns the orderId.
*/
public String getOrderId() {
return orderId;
}
/**
* @param orderId The orderId to set.
*/
public void setOrderId(String orderId) {
this.orderId = orderId;
}
/**
* @return Returns the address1.
*/
public String getAddress1() {
return address1;
}
/**
* @param address1 The address1 to set.
*/
public void setAddress1(String address1) {
this.address1 = address1;
}
/**
* @return Returns the address2.
*/
public String getAddress2() {
return address2;
}
/**
* @param address2 The address2 to set.
*/
public void setAddress2(String address2) {
this.address2 = address2;
}
/**
* @return Returns the city.
*/
public String getCity() {
return city;
}
/**
* @param city The city to set.
*/
public void setCity(String city) {
this.city = city;
}
/**
* @return Returns the datetimeReceived.
*/
public Timestamp getDateTimeReceived() {
return dateTimeReceived;
}
/**
* @param datetimeReceived The datetimeReceived to set.
*/
public void setDateTimeReceived(Timestamp dateTimeReceived) {
this.dateTimeReceived = dateTimeReceived;
}
/**
* @return Returns the entityId.
*/
public String getEntityIdSource() {
return entityIdSource;
}
/**
* @param entityId The entityId to set.
*/
public void setEntityIdSource(String entityId) {
this.entityIdSource = entityId;
}
/**
* @return Returns the entityIdCustomer.
*/
public String getEntityIdCustomer() {
return entityIdCustomer;
}
/**
* @param entityIdCustomer The entityIdCustomer to set.
*/
public void setEntityIdCustomer(String entityIdCustomer) {
this.entityIdCustomer = entityIdCustomer;
}
/**
* @return Returns the entityIdVendor.
*/
public String getEntityIdVendor() {
return entityIdVendor;
}
/**
* @param entityIdVendor The entityIdVendor to set.
*/
public void setEntityIdVendor(String entityIdVendor) {
this.entityIdVendor = entityIdVendor;
}
/**
* @return Returns the executerCompanyId.
*/
public String getExecuterCompanyId() {
return executerCompanyId;
}
/**
* @param executerCompanyId The executerCompanyId to set.
*/
public void setExecuterCompanyId(String executerCompanyId) {
this.executerCompanyId = executerCompanyId;
}
/**
* @return Returns the executerEntityHierarchyId.
*/
public String getExecuterEntityHierarchyId() {
return executerEntityHierarchyId;
}
/**
* @param executerEntityHierarchyId The executerEntityHierarchyId to set.
*/
public void setExecuterEntityHierarchyId(String executerEntityHierarchyId) {
this.executerEntityHierarchyId = executerEntityHierarchyId;
}
/**
* @return Returns the executerEntityId.
*/
public String getExecuterEntityId() {
return executerEntityId;
}
/**
* @param executerEntityId The executerEntityId to set.
*/
public void setExecuterEntityId(String executerEntityId) {
this.executerEntityId = executerEntityId;
}
/**
* @return Returns the idOrderOrigination.
*/
public String getIdOrderOrigination() {
return idOrderOrigination;
}
/**
* @param idOrderOrigination The idOrderOrigination to set.
*/
public void setIdOrderOrigination(String idOrderOrigination) {
this.idOrderOrigination = idOrderOrigination;
}
/**
* @return Returns the idOrderPriority.
*/
public String getIdOrderPriority() {
return idOrderPriority;
}
/**
* @param idOrderPriority The idOrderPriority to set.
*/
public void setIdOrderPriority(String idOrderPriority) {
this.idOrderPriority = idOrderPriority;
}
/**
* @return Returns the idOrderType.
*/
public String getIdOrderType() {
return idOrderType;
}
/**
* @param idOrderType The idOrderType to set.
*/
public void setIdOrderType(String idOrderType) {
this.idOrderType = idOrderType;
}
/**
* @return Returns the latitude.
*/
public Long getLatitude() {
return latitude;
}
/**
* @param latitude The latitude to set.
*/
public void setLatitude(Long latitude) {
this.latitude = latitude;
}
/**
* @return Returns the longitude.
*/
public Long getLongitude() {
return longitude;
}
/**
* @param longitude The longitude to set.
*/
public void setLongitude(Long longitude) {
this.longitude = longitude;
}
/**
* @return Returns the orderNumber.
*/
public String getOrderNumber() {
return orderNumber;
}
/**
* @param orderNumber The orderNumber to set.
*/
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
/**
* @return Returns the parcelNumber.
*/
public String getParcelNumber() {
return parcelNumber;
}
/**
* @param parcelNumber The parcelNumber to set.
*/
public void setParcelNumber(String parcelNumber) {
this.parcelNumber = parcelNumber;
}
/**
* @return Returns the referenceNumber.
*/
public String getReferenceNumber() {
return referenceNumber;
}
/**
* @param referenceNumber The referenceNumber to set.
*/
public void setReferenceNumber(String referenceNumber) {
this.referenceNumber = referenceNumber;
}
/**
* @return Returns the referenceNumberSource.
*/
public String getReferenceNumberSource() {
return referenceNumberSource;
}
/**
* @param referenceNumberSource The referenceNumberSource to set.
*/
public void setReferenceNumberSource(String referenceNumberSource) {
this.referenceNumberSource = referenceNumberSource;
}
/**
* @return Returns the requestDescription.
*/
public String getRequestDescription() {
return requestDescription;
}
/**
* @param requestDescription The requestDescription to set.
*/
public void setRequestDescription(String requestDescription) {
this.requestDescription = requestDescription;
}
/**
* @return Returns the requestSubject.
*/
public String getRequestSubject() {
return requestSubject;
}
/**
* @param requestSubject The requestSubject to set.
*/
public void setRequestSubject(String requestSubject) {
this.requestSubject = requestSubject;
}
/**
* @return Returns the state.
*/
public String getState() {
return state;
}
/**
* @param state The state to set.
*/
public void setState(String state) {
this.state = state;
}
/**
* @return Returns the valid.
*/
public Short getValid() {
return valid;
}
/**
* @param valid The valid to set.
*/
public void setValid(Short valid) {
this.valid = valid;
}
/**
* @return Returns the zip.
*/
public String getZip() {
return zip;
}
/**
* @param zip The zip to set.
*/
public void setZip(String zip) {
this.zip = zip;
}
/**
* @return Returns the zip4.
*/
public String getZip4() {
return zip4;
}
/**
* @param zip4 The zip4 to set.
*/
public void setZip4(String zip4) {
this.zip4 = zip4;
}
/**
* Implementation of the equals comparison on the basis of equality of the primary key values.
* @param rhs
* @return boolean
*/
public boolean equals(Object rhs)
{
if (rhs == null)
return false;
if (! (rhs instanceof OrderCreate))
return false;
OrderCreate that = (OrderCreate) rhs;
if (this.getId() != null && that.getId() != null)
{
if (! this.getId().equals(that.getId()))
{
return false;
}
}
return true;
}
/**
* Implementation of the hashCode method conforming to the Bloch pattern with
* the exception of array properties (these are very unlikely primary key types).
* @return int
*/
public int hashCode()
{
if (this.hashValue == 0)
{
int result = 17;
int IdValue = this.getId() == null ? 0 : this.getId().hashCode();
result = result * 37 + IdValue;
this.hashValue = result;
}
return this.hashValue;
}
}
I am creating a DAO to "run" this stored procedure, passing it in the OrderCreate object. What method call do I use to "run it".
Thanks
Tim