com.hyeb.entity.OrderEntity.java Source code

Java tutorial

Introduction

Here is the source code for com.hyeb.entity.OrderEntity.java

Source

/*
 * Copyright 2005-2013 shopxx.net. All rights reserved.
 * Support: http://www.shopxx.net
 * License: http://www.shopxx.net/license
 */
package com.hyeb.entity;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.validation.constraints.Min;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.hibernate.search.annotations.Analyze;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Store;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Entity - ?
 * 
 * @author SHOP++ Team
 * @version 3.0
 */
@MappedSuperclass
public abstract class OrderEntity extends BaseEntity implements Comparable<OrderEntity> {

    private static final long serialVersionUID = 5995013015967525827L;

    /** "?"?? */
    public static final String ORDER_PROPERTY_NAME = "order";

    /** ? */
    private Integer order;

    /**
     * ??
     * 
     * @return ?
     */
    @JsonProperty
    @Field(store = Store.YES, index = Index.YES, analyze = Analyze.NO)
    @Min(0)
    @Column(name = "orders")
    public Integer getOrder() {
        return order;
    }

    /**
     * ?
     * 
     * @param order
     *            ?
     */
    public void setOrder(Integer order) {
        this.order = order;
    }

    /**
     * compareTo
     * 
     * @param orderEntity
     *            ?
     * @return 
     */
    public int compareTo(OrderEntity orderEntity) {
        return new CompareToBuilder().append(getOrder(), orderEntity.getOrder())
                .append(getId(), orderEntity.getId()).toComparison();
    }

}