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",
41              query = "SELECT e FROM LastModified e "),
42          @NamedQuery(name = "LastModified.findById",
43              query = "SELECT e FROM LastModified e WHERE e.captureAgentId = :agentId"),
44          @NamedQuery(name = "LastModified.countAll",
45              query = "SELECT COUNT(e) FROM LastModified e ") })
46  @Table(name = "oc_scheduled_last_modified", indexes = {
47      @Index(name = "IX_oc_scheduled_last_modified_last_modified", columnList = ("last_modified")) })
48  public class LastModifiedDto {
49  
50    /** Capture agent ID */
51    @Id
52    @Column(name = "capture_agent_id", length = 255)
53    protected String captureAgentId;
54  
55    @Column(name = "last_modified", nullable = false)
56    @Temporal(TemporalType.TIMESTAMP)
57    protected Date lastModifiedDate;
58  
59    /**
60     * Default constructor without any import.
61     */
62    public LastModifiedDto() {
63    }
64  
65    /**
66     * Returns the capture agent ID.
67     *
68     * @return the capture agent ID
69     */
70    public String getCaptureAgentId() {
71      return captureAgentId;
72    }
73  
74    /**
75     * Sets the capture agent ID.
76     *
77     * @param captureAgentId
78     *          the capture agent ID
79     */
80    public void setCaptureAgentId(String captureAgentId) {
81      this.captureAgentId = captureAgentId;
82    }
83  
84    /**
85     * Returns the last modified date
86     *
87     * @return the review date
88     */
89    public Date getLastModifiedDate() {
90      return lastModifiedDate;
91    }
92  
93    /**
94     * Sets the last modified date
95     *
96     * @param lastModifiedDate
97     *          the last modified date
98     */
99    public void setLastModifiedDate(Date lastModifiedDate) {
100     this.lastModifiedDate = lastModifiedDate;
101   }
102 
103 }