Icon.java

package com.tradecloud.domain.common;

import com.tradecloud.common.base.StaticDataEntityBase;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "icon")
@Access(AccessType.FIELD)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "Icon")
//@Cacheable(value = "icon")
public class Icon extends IntegratedStaticDataEntityBase {

    private static final long serialVersionUID = 1L;

    // image
    private byte[] image;

    // For JPA only.
    public Icon() {
    }

    public Icon(String code) {
        super(code);
    }

    public Icon(String code, String name) {
        super(code, name);
    }

    public byte[] getImage() {
        return image;
    }

    public void setImage(byte[] image) {
        this.image = image;
    }

    @Override
    public int compareTo(StaticDataEntityBase o) {
        if (getName() != null && o.getName() != null) {
            return getName().compareToIgnoreCase(o.getName());
        }
        return 0;
    }
}