Mercurial > dive4elements > river
view backend/src/main/java/org/dive4elements/river/model/TimeInterval.java @ 9462:e28303971812
another log
author | gernotbelger |
---|---|
date | Wed, 29 Aug 2018 17:58:02 +0200 |
parents | df6f1b5806f6 |
children |
line wrap: on
line source
/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde * Software engineering by Intevation GmbH * * This file is Free Software under the GNU AGPL (>=v3) * and comes with ABSOLUTELY NO WARRANTY! Check out the * documentation coming with Dive4Elements River for details. */ package org.dive4elements.river.model; import java.io.Serializable; import java.util.Calendar; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.SequenceGenerator; import javax.persistence.Table; @Entity @Table(name = "time_intervals") public class TimeInterval implements Serializable { /** * Pseudo-date for Date values where only the year field is significant * (in Flys 3.2.1 June-15 12:00 had been used) */ public final static Calendar YEAR_ONLY_DATE; static { YEAR_ONLY_DATE = Calendar.getInstance(); YEAR_ONLY_DATE.clear(); YEAR_ONLY_DATE.set(0, Calendar.DECEMBER, 31, 3, 6, 5); } private Integer id; private Date startTime; private Date stopTime; public TimeInterval() { } public TimeInterval(final Date startTime, final Date stopTime) { this.startTime = startTime; this.stopTime = stopTime; } @Id @SequenceGenerator( name = "SEQUENCE_TIME_INTERVALS_ID_SEQ", sequenceName = "TIME_INTERVALS_ID_SEQ", allocationSize = 1) @GeneratedValue( strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_TIME_INTERVALS_ID_SEQ") @Column(name = "id") public Integer getId() { return this.id; } public void setId(final Integer id) { this.id = id; } @Column(name = "start_time") // FIXME: type mapping needed? public Date getStartTime() { return this.startTime; } public void setStartTime(final Date startTime) { this.startTime = startTime; } @Column(name = "stop_time") // FIXME: type mapping needed? public Date getStopTime() { return this.stopTime; } public void setStopTime(final Date stopTime) { this.stopTime = stopTime; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :