Files
Ger Roza 5aecdeb021 [BAEL-3066] Spring Security: Exploring JDBC Authentication (#7441)
* created multi-module project from spring-security-mvc-boot

* Added JDBC Authentication application to spring-security-mvc-boot-default

* Added JDBC Authentication application to spring-security-mvc-boot-mysql

* Added JDBC Authentication application to spring-security-mvc-boot-postgre

* adding new modules to parent spring-security-mvc-boot module, reformatting sql scripts, and added form fields to H2 LiveTest
2019-07-29 07:56:21 +02:00

64 lines
1.2 KiB
Java

package com.baeldung.models;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Tweet {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private long id;
private String tweet;
private String owner;
@ElementCollection(targetClass = String.class, fetch = FetchType.EAGER)
private Set<String> likes = new HashSet();
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
private Tweet() {
}
public Tweet(String tweet, String owner) {
this.tweet = tweet;
this.owner = owner;
}
public String getTweet() {
return tweet;
}
public void setTweet(String tweet) {
this.tweet = tweet;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public Set<String> getLikes() {
return likes;
}
public void setLikes(Set<String> likes) {
this.likes = likes;
}
}