/* * 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.catalog; // Generated Nov 11, 2009 10:40:37 AM by Hibernate Tools 3.2.4.GA import java.util.Date; import java.util.Locale; import java.util.Set; import com.salesmanager.core.entity.common.I18NEntity; import com.salesmanager.core.entity.customer.Customer; /** * review generated by hbm2java */ public class Review implements java.io.Serializable, I18NEntity { private long reviewId; private long productId; private long customerId; private String customerName; private Integer reviewRating; private Locale locale; private String productName; private Date dateAdded; private Date lastModified; private long reviewRead; private int status; private Customer customer; private Set<ReviewDescription> descriptions; public Set<ReviewDescription> getDescriptions() { return descriptions; } public void setDescriptions(Set<ReviewDescription> descriptions) { this.descriptions = descriptions; } private void init() { this.status = 1; } public Review() { init(); } public String getDescription() { ReviewDescription desc = null; if (this.getDescriptions() != null && this.getDescriptions().size() > 0) { ReviewDescription[] descArray = (ReviewDescription[]) this .getDescriptions() .toArray( new ReviewDescription[this.getDescriptions().size()]); if (descArray != null && descArray.length > 0) { desc = descArray[0]; } } if (desc != null) { return desc.getReviewText(); } else { return ""; } } public String getProductName() { return productName; } public void setProductName(String productName) { this.productName = productName; } public void setLocale(Locale locale) { this.locale = locale; if (this.getCustomer() != null) { this.getCustomer().setLocale(locale); } } public void setLocale(Locale locale, String currency) { this.locale = locale; } public Review(long productId, String customerName, long reviewRead, int status) { this.productId = productId; this.customerName = customerName; this.reviewRead = reviewRead; this.status = status; } public Review(long productId, long customerId, String customerName, int reviewRating, Date dateAdded, Date lastModified, long reviewRead, int status) { this.productId = productId; this.customerId = customerId; this.customerName = customerName; this.reviewRating = reviewRating; this.dateAdded = dateAdded; this.lastModified = lastModified; this.reviewRead = reviewRead; this.status = status; } public long getReviewId() { return reviewId; } public void setReviewId(long reviewId) { this.reviewId = reviewId; } public long getProductId() { return productId; } public void setProductId(long productId) { this.productId = productId; } public long getCustomerId() { return customerId; } public void setCustomerId(long customerId) { this.customerId = customerId; } public String getCustomerName() { return customerName; } public void setCustomerName(String customerName) { this.customerName = customerName; } public Integer getReviewRating() { return reviewRating; } public void setReviewRating(Integer reviewRating) { this.reviewRating = reviewRating; } public Date getDateAdded() { return dateAdded; } public void setDateAdded(Date dateAdded) { this.dateAdded = dateAdded; } public Date getLastModified() { return lastModified; } public void setLastModified(Date lastModified) { this.lastModified = lastModified; } public long getReviewRead() { return reviewRead; } public void setReviewRead(long reviewRead) { this.reviewRead = reviewRead; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public Locale getLocale() { return locale; } public Customer getCustomer() { return customer; } public void setCustomer(Customer customer) { this.customer = customer; } }