00001 package cedar.hepdata.model;
00002
00003 import cedar.hepdata.util.Unit;
00004
00005 import javax.persistence.*;
00006
00012 @Entity
00013 @Table(name="DatasetProperties")
00014 public class DatasetProperty extends Property {
00016 @ManyToOne
00017 private Dataset _dataset;
00018
00019
00021
00022
00024 public DatasetProperty() {}
00025
00027 public DatasetProperty(String name) {
00028 super(name);
00029 }
00030
00032 public DatasetProperty(Dataset dataset, String name) {
00033 this(name);
00034 setDataset(dataset);
00035 }
00036
00038 public DatasetProperty(String name, Unit unit, Double lowValue, Double highValue) {
00039 super(name, unit, lowValue, highValue);
00040 }
00041
00043 public DatasetProperty(Dataset dataset, String name, Unit unit, Double lowValue, Double highValue) {
00044 this(name, unit, lowValue, highValue);
00045 setDataset(dataset);
00046 }
00047
00048
00050
00051
00052
00053 public Dataset getDataset() {
00054 return _dataset;
00055 }
00056 public DatasetProperty setDataset(Dataset dataset) {
00057 if (getDataset() != null) {
00058 getDataset().getProperties().add(this);
00059 }
00060 _dataset = dataset;
00061 return this;
00062 }
00063
00064 }