com.dp2345.entity.OrderEntity.java Source code

Java tutorial

Introduction

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

Source

/*
 * Copyright 2013-2015 cetvision.com. All rights reserved.
 * Support: http://www.cetvision.com
 * License: http://www.cetvision.com/license
 */
package com.dp2345.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.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Store;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Entity - ?
 * 
 * @author CETVISION CORP
 * @version 2.0.3
 */
@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.UN_TOKENIZED)
    @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();
    }

}