Mercurial > hg > LGServices
view src/main/java/de/mpiwg/gazetteer/bo/Sequence.java @ 105:16a0796e3871 default tip
remove "console.log" from general.js
author | Calvin Yeh <cyeh@mpipw-berlin.mpg.com> |
---|---|
date | Fri, 29 Sep 2017 16:18:02 +0200 |
parents | 3e62083dbcbf |
children |
line wrap: on
line source
package de.mpiwg.gazetteer.bo; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; /** * * @author jurzua */ @Entity @Table(name="row_sequence") public class Sequence implements Serializable { private static final long serialVersionUID = 120128920808559599L; public Sequence(){} public Sequence(String name, Long value){ this.lastValue = value; this.name = name; } @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Column(name="name") private String name; @Column(name="last_value") private Long lastValue; public Long generateId(){ return this.lastValue++; } public Long getLastValue() { return lastValue; } public void setLastValue(Long lastValue) { this.lastValue = lastValue; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Sequence)) { return false; } Sequence other = (Sequence) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; } @Override public String toString() { return "org.mpi.openmind.ontology.joins.Sequence[id=" + id + "]"; } }