package at.fhj.swd14.pse.community;

import java.io.Serializable;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import at.fhj.swd14.pse.user.User;
import at.fhj.swd14.pse.user.UserDto;

@Entity
@Table(name = "community")
public class Community implements Serializable {
	private static final long serialVersionUID = 1L;
	
	
	@Id
	private Long id;
	
	public Long getId()
	{
		return this.id;
	}
	
	public void setId(Long id)
	{
		this.id = id;
	}
	
	@Column
	private String name;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	private User author;
	public User getAuthor() {
		return this.author;
	}
	
	public void setAuthor(User author){
		this.author = author;
	}
	
	@Column
	private boolean isPublic = false;
    public boolean getPublicState(){
    	return this.isPublic;
    }
    
    public void setPublicState(boolean publicState){
    	this.isPublic = publicState;
    }

    private List<UserDto> allowedUsers = new ArrayList<UserDto>();
    
    public List<UserDto> getAllowedUsers(){
    	
    	return this.allowedUsers;
    }
    
    public void setAllowedUsers(List<UserDto> allowedUsers){
    	this.allowedUsers = allowedUsers;
    }
	
    @Column
    private Date createTime= new Date(0);
    public Date getCreateTime(){
    	return createTime;
    }
    
    public void setCreateTime(Date createDate){
    	this.createTime = createDate;
    }
	
}

@@ -419,17 +419,20 @@
 zable %7B%0A
-%09
+    
 private 
@@ -476,18 +476,22 @@
 1L;%0A
-%09%0A%09%0A%09@Id%0A%09
+%0A%0A    @Id%0A    
 priv
@@ -503,19 +503,21 @@
 ong id;%0A
-%09%0A%09
+%0A    
 public L
@@ -527,22 +527,27 @@
  getId()
-%0A%09%7B%0A%09%09
+ %7B%0A        
 return t
@@ -554,22 +554,27 @@
 his.id;%0A
-%09%7D%0A%09%0A%09
+    %7D%0A%0A    
 public v
@@ -595,14 +595,19 @@
  id)
-%0A%09%7B%0A%09%09
+ %7B%0A        
 this
@@ -616,30 +616,35 @@
 d = id;%0A
-%09%7D%0A%09%0A%09
+    %7D%0A%0A    
 @Column%0A
 %09private
@@ -627,33 +627,36 @@
  %7D%0A%0A    @Column%0A
-%09
+    
 private String n
@@ -660,17 +660,21 @@
 g name;%0A
-%09
+%0A    
 public S
@@ -687,26 +687,32 @@
 getName() %7B%0A
-%09%09
+        
 return name;
@@ -712,20 +712,27 @@
 n name;%0A
-%09%7D%0A%09
+    %7D%0A%0A    
 public v
@@ -758,18 +758,24 @@
 name) %7B%0A
-%09%09
+        
 this.nam
@@ -788,12 +788,21 @@
 me;%0A
-%09%7D%0A%0A
+    %7D%0A%0A    //
 %09pri
@@ -819,17 +819,20 @@
 author;%0A
-%09
+    
 public U
@@ -849,18 +849,47 @@
 hor() %7B%0A
-%09%09
+        return null;%0A//        
 return t
@@ -900,22 +900,27 @@
 author;%0A
-%09%7D%0A%09%0A%09
+    %7D%0A%0A    
 public v
@@ -945,18 +945,21 @@
  author)
+ 
 %7B%0A
+//
 %09%09this.a
@@ -978,22 +978,27 @@
 or;%0A
-%09%7D%0A%09%0A%09
+    %7D%0A%0A    
 @Column%0A
 %09pri
@@ -993,17 +993,20 @@
 @Column%0A
-%09
+    
 private 
@@ -1031,16 +1031,17 @@
  false;%0A
+%0A
     publ
@@ -1067,23 +1067,27 @@
 cState()
+ 
 %7B%0A    
-%09
+    
 return t
@@ -1098,36 +1098,32 @@
 isPublic;%0A    %7D%0A
-    
 %0A    public void
@@ -1154,31 +1154,35 @@
 publicState)
+ 
 %7B%0A    
-%09
+    
 this.isPubli
@@ -1201,24 +1201,26 @@
 ate;%0A    %7D%0A%0A
+//
     private 
@@ -1274,20 +1274,16 @@
 Dto%3E();%0A
-    
 %0A    pub
@@ -1321,16 +1321,34 @@
 rs()
+ 
 %7B%0A    
+ 
-%09%0A
+   return null;%0A//
     
@@ -1372,36 +1372,32 @@
 wedUsers;%0A    %7D%0A
-    
 %0A    public void
@@ -1440,23 +1440,29 @@
 edUsers)
+ 
 %7B%0A
+//
     
-%09
+    
 this.all
@@ -1493,17 +1493,16 @@
 ;%0A    %7D%0A
-%09
 %0A    @Co
@@ -1533,16 +1533,17 @@
 eateTime
+ 
 = new Da
@@ -1549,16 +1549,17 @@
 ate(0);%0A
+%0A
     publ
@@ -1581,23 +1581,27 @@
 teTime()
+ 
 %7B%0A    
-%09
+    
 return c
@@ -1617,20 +1617,16 @@
 ;%0A    %7D%0A
-    
 %0A    pub
@@ -1668,15 +1668,19 @@
 ate)
+ 
 %7B%0A    
-%09
+    
 this
@@ -1711,12 +1711,11 @@
 ;%0A    %7D%0A
-%09
 %0A%7D%0A

make the deployment green again