// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

@Entity
@Table(name="asset")
@Inheritance(strategy=InheritanceType.JOINED)
public class AssetJPA {
    public static final int TRUCK = 1;
    public static final int TRAILER = 2;
    public static final int TOOL = 3;
    private int id;
    private String description;
    private int assetType;
    public AssetJPA() {
        this(0, "", 0);
    }
    public AssetJPA(int id, String description, int assetType) {
        this.id = id;
        this.description = description;
        this.assetType = assetType;
    }
    @Id
    @Column(name="id")
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    @Column(name="description")
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    @Column(name="assettype")
    public int getAssetType() {
        return assetType;
    }
    public void setAssetType(int assetType) {
        this.assetType = assetType;
    }
}
