Commit 83f0a642 authored by Matija Obreza's avatar Matija Obreza
Browse files

Parameter and Method are ACL aware; removed NOT NULL from some fields

parent 75477eff
......@@ -24,11 +24,12 @@ import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.genesys2.server.model.AclAwareModel;
import org.genesys2.server.model.BusinessModel;
@Entity
@Table(name = "methods")
public class Method extends BusinessModel {
public class Method extends BusinessModel implements AclAwareModel {
/**
*
......@@ -53,7 +54,7 @@ public class Method extends BusinessModel {
@Column(nullable = false)
private int fieldType;
@Column(nullable = false, length = 10)
@Column(nullable = true, length = 10)
private String fieldSize;
@Column(name = "\"range\"", length = 32)
......
......@@ -18,43 +18,33 @@ package org.genesys2.server.model.genesys;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.genesys2.server.model.AclAwareModel;
import org.genesys2.server.model.BusinessModel;
import org.genesys2.server.model.impl.Crop;
@Entity
@Table(name = "parameters")
public class Parameter implements java.io.Serializable {
public class Parameter extends BusinessModel implements AclAwareModel {
/**
*
*/
private static final long serialVersionUID = -4831244149317371274L;
private Long id;
// private Language language;
@ManyToOne(cascade = {}, optional = false)
@JoinColumn(name = "Crop_Id")
private Crop crop;
// private Category category;
@Column(nullable = false, length = 32)
private String title;
public Parameter() {
}
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "Par_Id")
public Long getId() {
return this.id;
}
public void setId(final Long parId) {
this.id = parId;
}
// @ManyToOne(cascade = {}, optional = false)
// @JoinColumn(name = "languageId")
// public Language getLanguage() {
......@@ -65,8 +55,6 @@ public class Parameter implements java.io.Serializable {
// this.language = language;
// }
@ManyToOne(cascade = {}, optional = false)
@JoinColumn(name = "Crop_Id")
public Crop getCrop() {
return this.crop;
}
......@@ -85,7 +73,6 @@ public class Parameter implements java.io.Serializable {
// this.category = category;
// }
@Column(nullable = false, length = 32)
public String getTitle() {
return this.title;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment