View Javadoc

1   package ch.busyboxes.agoo.model;
2   
3   import java.util.List;
4   
5   import javax.persistence.Basic;
6   import javax.persistence.CascadeType;
7   import javax.persistence.Entity;
8   import javax.persistence.FetchType;
9   import javax.persistence.GeneratedValue;
10  import javax.persistence.Id;
11  import javax.persistence.OneToMany;
12  import javax.persistence.Table;
13  
14  /**
15   * A folder watched by the Agoo system, it's basically a
16   * container for watched files
17   * 
18   * @author julien@busyboxes.ch
19   */
20  @Entity
21  @Table(name = "agoo_watched_folders")
22  public class WatchedFolder {
23  
24  	/** The id of the folder */
25  	@Id
26  	@GeneratedValue
27  	private Long id;
28  	
29  	/** The folder path */
30  	@Basic
31  	private String folderPath;
32  	
33  	/** The list of watched contained in this folder */
34  	@OneToMany(mappedBy = "watchedFolder", fetch = FetchType.EAGER, cascade = {CascadeType.REMOVE})
35  	private List<WatchedFile> watchedFiles;
36  	
37  	/**
38  	 * Returns the id of the watched folder
39  	 * 
40  	 * @return the id of the watched folder
41  	 */
42  	public Long getId() {
43  		return id;
44  	}
45  
46  	/**
47  	 * Returns the path corresponding to this folder
48  	 * 
49  	 * @return the folderPath the path of this folder
50  	 */
51  	public String getFolderPath() {
52  		return folderPath;
53  	}
54  
55  	/**
56  	 * Sets the path corresponding to this folder
57  	 * 
58  	 * @param folderPath the folder's path to set
59  	 */
60  	public void setFolderPath(String folderPath) {
61  		this.folderPath = folderPath;
62  	}
63  
64  	/**
65  	 * Returns the list of files associated with this folder
66  	 * 
67  	 * @return the watchedFiles the list of files associated
68  	 */
69  	public List<WatchedFile> getWatchedFiles() {
70  		return watchedFiles;
71  	}
72  
73  	/**
74  	 * Sets the list of files associated with this folder
75  	 * 
76  	 * @param watchedFiles the watched files list to set
77  	 */
78  	public void setWatchedFiles(List<WatchedFile> watchedFiles) {
79  		this.watchedFiles = watchedFiles;
80  	}
81  
82  
83  }