Mercurial > hg > SpringPlayground
view spring-boot-playground/src/main/java/de/comline/spring/entity/Movie.java @ 8:7ce4367b50bc
Ein echter Unit Test, der eine in-memory H2 als Teil vom Test startet, das Schema mit liquibase erzeugt und nach dem Test wieder stoppt. Das alles ohne die Web Controller zu starten.
author | Dirk Olmes <dirk.olmes@codedo.de> |
---|---|
date | Thu, 13 Aug 2020 16:51:05 +0200 |
parents | 92d52e4ac567 |
children |
line wrap: on
line source
package de.comline.spring.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "MOVIE") public class Movie { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "ID") private long id; @Column(name = "TITLE") private String title; /** * This default constructor is required for hibernate but should not be used from client code. */ @Deprecated protected Movie() { super(); } public Movie(String title) { this.title = title; } public long getId() { return id; } public String getTitle() { return title; } }