/*
* Licensed to csti consulting
* You may obtain a copy of the License at
*
* http://www.csticonsulting.com
* Copyright (c) 2006-Aug 24, 2010 Consultation CS-TI inc.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.salesmanager.core.entity.orders;
// Generated Oct 1, 2008 9:31:43 AM by Hibernate Tools 3.2.0.beta8
import java.math.BigDecimal;
/**
* OrdersProductsAttributes generated by hbm2java
*/
public class OrderProductAttribute implements java.io.Serializable {
// Fields
private long orderProductAttributeId;
private long orderId;
private long orderProductId;
private String productOption;
private String productOptionValue;
private BigDecimal optionValuePrice;
private boolean productAttributeIsFree;
private java.math.BigDecimal productAttributeWeight;
private long productOptionId;
private long productOptionValueId;
private String price;
// custom fields
private long productAttributeId;
// Constructors
public OrderProductAttribute(long orderProductAttributeId, long orderId,
long orderProductId, String productOption,
String productOptionValue, BigDecimal optionValuePrice,
boolean productAttributeIsFree,
java.math.BigDecimal productAttributeWeight, long productOptionId,
long productOptionValueId) {
super();
this.orderProductAttributeId = orderProductAttributeId;
this.orderId = orderId;
this.orderProductId = orderProductId;
this.productOption = productOption;
this.productOptionValue = productOptionValue;
this.optionValuePrice = optionValuePrice;
this.productAttributeIsFree = productAttributeIsFree;
this.productAttributeWeight = productAttributeWeight;
this.productOptionId = productOptionId;
this.productOptionValueId = productOptionValueId;
}
/** default constructor */
public OrderProductAttribute() {
}
public BigDecimal getOptionValuePrice() {
return optionValuePrice;
}
public void setOptionValuePrice(BigDecimal optionValuePrice) {
this.optionValuePrice = optionValuePrice;
}
public long getOrderId() {
return orderId;
}
public void setOrderId(long orderId) {
this.orderId = orderId;
}
public long getOrderProductAttributeId() {
return orderProductAttributeId;
}
public void setOrderProductAttributeId(long orderProductAttributeId) {
this.orderProductAttributeId = orderProductAttributeId;
}
public long getOrderProductId() {
return orderProductId;
}
public void setOrderProductId(long orderProductId) {
this.orderProductId = orderProductId;
}
public boolean isProductAttributeIsFree() {
return productAttributeIsFree;
}
public void setProductAttributeIsFree(boolean productAttributeIsFree) {
this.productAttributeIsFree = productAttributeIsFree;
}
public long getProductOptionId() {
return productOptionId;
}
public void setProductOptionId(long productOptionId) {
this.productOptionId = productOptionId;
}
public String getProductOptionValue() {
return productOptionValue;
}
public void setProductOptionValue(String productOptionValue) {
this.productOptionValue = productOptionValue;
}
public long getProductOptionValueId() {
return productOptionValueId;
}
public void setProductOptionValueId(long productOptionValueId) {
this.productOptionValueId = productOptionValueId;
}
public String getAttributeValue() {
if (this.getProductOptionValue() != null) {
return new String(getProductOptionValue());
} else {
return "###";
}
}
public java.math.BigDecimal getProductAttributeWeight() {
return productAttributeWeight;
}
public void setProductAttributeWeight(
java.math.BigDecimal productAttributeWeight) {
this.productAttributeWeight = productAttributeWeight;
}
public String getProductOption() {
return productOption;
}
public void setProductOption(String productOption) {
this.productOption = productOption;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public long getProductAttributeId() {
return productAttributeId;
}
public void setProductAttributeId(long productAttributeId) {
this.productAttributeId = productAttributeId;
}
@Override
public int hashCode() {
final int PRIME = 31;
int result = 1;
result = PRIME
* result
+ ((optionValuePrice == null) ? 0 : optionValuePrice.hashCode());
result = PRIME * result + (int) (orderId ^ (orderId >>> 32));
result = PRIME
* result
+ (int) (orderProductAttributeId ^ (orderProductAttributeId >>> 32));
result = PRIME * result
+ (int) (orderProductId ^ (orderProductId >>> 32));
result = PRIME * result + ((price == null) ? 0 : price.hashCode());
result = PRIME * result + (productAttributeIsFree ? 1231 : 1237);
result = PRIME
* result
+ ((productAttributeWeight == null) ? 0
: productAttributeWeight.hashCode());
result = PRIME * result
+ ((productOption == null) ? 0 : productOption.hashCode());
result = PRIME * result
+ (int) (productOptionId ^ (productOptionId >>> 32));
result = PRIME
* result
+ ((productOptionValue == null) ? 0 : productOptionValue
.hashCode());
result = PRIME * result
+ (int) (productOptionValueId ^ (productOptionValueId >>> 32));
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final OrderProductAttribute other = (OrderProductAttribute) obj;
if (optionValuePrice == null) {
if (other.optionValuePrice != null)
return false;
} else if (!optionValuePrice.equals(other.optionValuePrice))
return false;
if (orderId != other.orderId)
return false;
if (orderProductAttributeId != other.orderProductAttributeId)
return false;
if (orderProductId != other.orderProductId)
return false;
if (price == null) {
if (other.price != null)
return false;
} else if (!price.equals(other.price))
return false;
if (productAttributeIsFree != other.productAttributeIsFree)
return false;
if (productAttributeWeight == null) {
if (other.productAttributeWeight != null)
return false;
} else if (!productAttributeWeight.equals(other.productAttributeWeight))
return false;
if (productOption == null) {
if (other.productOption != null)
return false;
} else if (!productOption.equals(other.productOption))
return false;
if (productOptionId != other.productOptionId)
return false;
if (productOptionValue == null) {
if (other.productOptionValue != null)
return false;
} else if (!productOptionValue.equals(other.productOptionValue))
return false;
if (productOptionValueId != other.productOptionValueId)
return false;
return true;
}
}