Mercurial > hg > LGDataverses
comparison src/main/java/edu/harvard/iq/dataverse/ControlledVocabAlternate.java @ 10:a50cf11e5178
Rewrite LGDataverse completely upgrading to dataverse4.0
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Tue, 08 Sep 2015 17:00:21 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 9:5926d6419569 | 10:a50cf11e5178 |
|---|---|
| 1 /* | |
| 2 * To change this license header, choose License Headers in Project Properties. | |
| 3 * To change this template file, choose Tools | Templates | |
| 4 * and open the template in the editor. | |
| 5 */ | |
| 6 package edu.harvard.iq.dataverse; | |
| 7 | |
| 8 import java.io.Serializable; | |
| 9 import java.util.Objects; | |
| 10 import javax.persistence.Column; | |
| 11 import javax.persistence.Entity; | |
| 12 import javax.persistence.GeneratedValue; | |
| 13 import javax.persistence.GenerationType; | |
| 14 import javax.persistence.Id; | |
| 15 import javax.persistence.JoinColumn; | |
| 16 import javax.persistence.ManyToOne; | |
| 17 | |
| 18 /** | |
| 19 * | |
| 20 * @author ellenk | |
| 21 */ | |
| 22 @Entity | |
| 23 public class ControlledVocabAlternate implements Serializable { | |
| 24 @Id | |
| 25 @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 26 private Long id; | |
| 27 | |
| 28 public Long getId() { | |
| 29 return this.id; | |
| 30 } | |
| 31 | |
| 32 public void setId(Long id) { | |
| 33 this.id = id; | |
| 34 } | |
| 35 | |
| 36 @Column(columnDefinition="TEXT", nullable = false) | |
| 37 private String strValue; | |
| 38 | |
| 39 public String getStrValue() { | |
| 40 return strValue; | |
| 41 } | |
| 42 public void setStrValue(String strValue) { | |
| 43 this.strValue = strValue; | |
| 44 | |
| 45 } | |
| 46 | |
| 47 @ManyToOne | |
| 48 @JoinColumn( nullable = false ) | |
| 49 private DatasetFieldType datasetFieldType; | |
| 50 | |
| 51 public DatasetFieldType getDatasetFieldType() { | |
| 52 return datasetFieldType; | |
| 53 } | |
| 54 public void setDatasetFieldType(DatasetFieldType datasetFieldType) { | |
| 55 this.datasetFieldType = datasetFieldType; | |
| 56 } | |
| 57 | |
| 58 @ManyToOne | |
| 59 @JoinColumn( nullable = false ) | |
| 60 private ControlledVocabularyValue controlledVocabularyValue; | |
| 61 | |
| 62 public ControlledVocabularyValue getControlledVocabularyValue() { | |
| 63 return controlledVocabularyValue; | |
| 64 } | |
| 65 | |
| 66 public void setControlledVocabularyValue(ControlledVocabularyValue controlledVocabularyValue) { | |
| 67 this.controlledVocabularyValue = controlledVocabularyValue; | |
| 68 } | |
| 69 | |
| 70 @Override | |
| 71 public int hashCode() { | |
| 72 int hash = 7; | |
| 73 hash = 41 * hash + Objects.hashCode(this.id); | |
| 74 return hash; | |
| 75 } | |
| 76 | |
| 77 @Override | |
| 78 public boolean equals(Object obj) { | |
| 79 if (obj == null) { | |
| 80 return false; | |
| 81 } | |
| 82 if (getClass() != obj.getClass()) { | |
| 83 return false; | |
| 84 } | |
| 85 final ControlledVocabAlternate other = (ControlledVocabAlternate) obj; | |
| 86 if (!Objects.equals(this.id, other.id)) { | |
| 87 return false; | |
| 88 } | |
| 89 return true; | |
| 90 } | |
| 91 | |
| 92 | |
| 93 } |
