Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/main/java/se/kth/sda6/skeleton/posts/Post.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
package se.kth.sda6.skeleton.posts;

import org.hibernate.annotations.GeneratorType;

import javax.persistence.*;

// @TODO add Hibernate annotations to define which table and columns should be used to save the Post Object.
@Entity
@Table(name = "post")
public class Post {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(name = "body")
private String body;

// @OneToMany(mappedBy = "post", cascade = CascadeType.ALL)
Expand Down