package com.sauloaraujo.timesheet.domain.user;

import java.util.List;

import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.springframework.hateoas.Identifiable;

import lombok.Getter;
import lombok.Setter;

@Entity
@Table(
	name="USERS", 
	uniqueConstraints=@UniqueConstraint(columnNames="username")
)
@Setter
@Getter
public class User implements Identifiable<String> {
/*	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="id")
	private Integer id; 
*/	
	
	@Id
	@Column(name="username")
	@Size(max=50)
	private String username;
	
	@Override
	public String getId() {
		return username;
	}
	
	@NotNull
	@Size(max=50)
	private String password;
	
	@NotNull
	private boolean enabled;
	
	@ElementCollection
	@CollectionTable(
		name="authorities", 
		joinColumns=@JoinColumn(name="username"),
		uniqueConstraints=@UniqueConstraint(columnNames={"username", "authority"})
	)
	@Column(name="authority", length=50)
	private List<String> authorities;
}
@@ -708,116 +708,8 @@
 %3E %7B%0A
-/*%09%0A%09@Id%0A%09@GeneratedValue(strategy=GenerationType.IDENTITY)%0A%09@Column(name=%22id%22)%0A%09private Integer id; %0A*/%09%0A%09%0A
 %09@Id

Remove comment