BrightSide Workbench Full Report + Source Code
MaintenancePlan.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 package org.turro.erp.entity;
19 
20 import java.util.Date;
21 import java.util.HashSet;
22 import java.util.Set;
23 import javax.persistence.CascadeType;
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.FetchType;
27 import javax.persistence.GeneratedValue;
28 import javax.persistence.GenerationType;
29 import javax.persistence.Id;
30 import javax.persistence.ManyToOne;
31 import javax.persistence.OneToMany;
32 import javax.persistence.Temporal;
33 import javax.persistence.TemporalType;
34 
39 @Entity
40 public class MaintenancePlan implements java.io.Serializable {
41 
42  @Id
43  @GeneratedValue(strategy=GenerationType.IDENTITY)
44  @Column(name="IDENTIFIER")
45  private long id;
46 
47  @Column(name="MAINTENANCE_NAME", unique = true, nullable = false)
48  private String name;
49 
50  @Column(name="START_DATE")
51  @Temporal(value = TemporalType.DATE)
52  private Date startDate;
53 
54  @Column(name="END_DATE")
55  @Temporal(value = TemporalType.DATE)
56  private Date endDate;
57 
58  @OneToMany(mappedBy = "maintenancePlan", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval=true)
59  private Set<Schedule> schedules = new HashSet<Schedule>();
60 
61  @ManyToOne
62  private org.turro.erp.entity.OrderReference orderReference;
63 
64 }