View Javadoc
1   /*
2    * Licensed to The Apereo Foundation under one or more contributor license
3    * agreements. See the NOTICE file distributed with this work for additional
4    * information regarding copyright ownership.
5    *
6    *
7    * The Apereo Foundation licenses this file to you under the Educational
8    * Community License, Version 2.0 (the "License"); you may not use this file
9    * except in compliance with the License. You may obtain a copy of the License
10   * at:
11   *
12   *   http://opensource.org/licenses/ecl2.txt
13   *
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
17   * License for the specific language governing permissions and limitations under
18   * the License.
19   *
20   */
21  package org.opencastproject.scheduler.impl.persistence;
22  
23  import java.util.Date;
24  
25  import javax.persistence.Column;
26  import javax.persistence.Entity;
27  import javax.persistence.Id;
28  import javax.persistence.Index;
29  import javax.persistence.NamedQueries;
30  import javax.persistence.NamedQuery;
31  import javax.persistence.Table;
32  import javax.persistence.Temporal;
33  import javax.persistence.TemporalType;
34  
35  /**
36   * Entity object for storing scheduled last modified dates in persistence storage.
37   */
38  @Entity(name = "LastModified")
39  @NamedQueries({
40          @NamedQuery(name = "LastModified.findAll", query = "SELECT e FROM LastModified e "),
41          @NamedQuery(name = "LastModified.findById", query = "SELECT e FROM LastModified e WHERE e.captureAgentId = :agentId"),
42          @NamedQuery(name = "LastModified.countAll", query = "SELECT COUNT(e) FROM LastModified e ") })
43  @Table(name = "oc_scheduled_last_modified", indexes = {
44      @Index(name = "IX_oc_scheduled_last_modified_last_modified", columnList = ("last_modified")) })
45  public class LastModifiedDto {
46  
47    /** Capture agent ID */
48    @Id
49    @Column(name = "capture_agent_id", length = 255)
50    protected String captureAgentId;
51  
52    @Column(name = "last_modified", nullable = false)
53    @Temporal(TemporalType.TIMESTAMP)
54    protected Date lastModifiedDate;
55  
56    /**
57     * Default constructor without any import.
58     */
59    public LastModifiedDto() {
60    }
61  
62    /**
63     * Returns the capture agent ID.
64     *
65     * @return the capture agent ID
66     */
67    public String getCaptureAgentId() {
68      return captureAgentId;
69    }
70  
71    /**
72     * Sets the capture agent ID.
73     *
74     * @param captureAgentId
75     *          the capture agent ID
76     */
77    public void setCaptureAgentId(String captureAgentId) {
78      this.captureAgentId = captureAgentId;
79    }
80  
81    /**
82     * Returns the last modified date
83     *
84     * @return the review date
85     */
86    public Date getLastModifiedDate() {
87      return lastModifiedDate;
88    }
89  
90    /**
91     * Sets the last modified date
92     *
93     * @param lastModifiedDate
94     *          the last modified date
95     */
96    public void setLastModifiedDate(Date lastModifiedDate) {
97      this.lastModifiedDate = lastModifiedDate;
98    }
99  
100 }