// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
package demo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="t")
public class AllFields {
    private int f1;
    private String f2;
    private int f3;
    private String f4;
    public AllFields() {
        this(0, "", 0, "");
    }
    public AllFields(int f1, String f2, int f3, String f4) {
        this.f1 = f1;
        this.f2 = f2;
        this.f3 = f3;
        this.f4 = f4;
    }
    @Id
    @Column(name="f1")
    public int getF1() {
        return f1;
    }
    public void setF1(int f1) {
        this.f1 = f1;
    }
    @Column(name="f2")
    public String getF2() {
        return f2;
    }
    public void setF2(String f2) {
        this.f2 = f2;
    }
    @Column(name="f3")
    public int getF3() {
        return f3;
    }
    public void setF3(int f3) {
        this.f3 = f3;
    }
    @Column(name="f4")
    public String getF4() {
        return f4;
    }
    public void setF4(String f4) {
        this.f4 = f4;
    }
    @Override
    public String toString() {
        return String.format("All (%d,%s,%d,%s)", getF1(), getF2(), f3, f4);
    }
}
