This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Spring Boot: must use @..@ instead of ${...} https://docs.spring.io/spring-boot/docs/current/reference/html/howto-properties-and-configuration.html | |
[email protected]@ | |
[email protected]@ | |
[email protected]@ | |
[email protected]@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.operatornew.gamemanager.domain; | |
import javax.persistence.Entity; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.GenerationType; | |
import javax.persistence.Id; | |
import javax.persistence.Table; | |
@Entity | |
@Table(name = "game") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>dbunit-maven-plugin</artifactId> | |
<version>1.0-beta-3</version> | |
<configuration> | |
<dataTypeFactoryName>${dbunit.dataTypeFactoryName}</dataTypeFactoryName> | |
<driver>${jdbc.driverClassName}</driver> | |
<username>${jdbc.username}</username> | |
<password>${jdbc.password}</password> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<dataset> | |
<table name="game"> | |
<column>id</column> | |
<column>name</column> | |
<column>description</column> | |
<row> | |
<value description="id">-1</value> | |
<value description="name">name1</value> | |
<value description="description">desc1</value> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.operatornew.gamemanager.repository; | |
import com.operatornew.gamemanager.domain.Game; | |
import org.springframework.data.repository.PagingAndSortingRepository; | |
public interface GameRepository extends PagingAndSortingRepository<Game, Integer> { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.operatornew.gamemanager; | |
import com.operatornew.gamemanager.domain.Game; | |
import com.operatornew.gamemanager.repository.GameRepository; | |
import java.util.ArrayList; | |
import java.util.List; | |
import static org.junit.Assert.assertEquals; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[INFO] --- dbunit-maven-plugin:1.0-beta-3:operation (test-compile) @ spring-boot-mysql --- | |
78 [main] INFO org.dbunit.database.DatabaseDataSet - | |
database name=MySQL | |
database version=5.6.36-82.0 | |
database major version=5 | |
database minor version=6 | |
jdbc driver name=MySQL Connector Java | |
jdbc driver version=mysql-connector-java-5.1.35 ( Revision: 5fb9c5849535c13917c2cf9baaece6ef9693ef27 ) | |
jdbc driver major version=5 | |
jdbc driver minor version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<build> | |
<plugins> | |
... | |
<plugin> | |
<groupId>de.juplo</groupId> | |
<artifactId>hibernate-maven-plugin</artifactId> | |
<version>2.0.0</version> | |
<executions> | |
<execution> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.spring.io/spring-boot/docs/current/reference/html/howto-properties-and-configuration.html | |
# Must use @...@ instead of ${...} | |
[email protected]@ | |
# Needed by Hibernate3 Maven Plugin defined in pom.xml | |
hibernate.connection.username= @jdbc.username@ | |
[email protected]@ | |
[email protected]@ | |
[email protected]@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- hibernate-maven-plugin:2.0.0:drop (default) @ spring-boot-mysql --- | |
[INFO] HHH000318: Could not find any META-INF/persistence.xml file in the classpath | |
[INFO] Found no META-INF/persistence.xml. | |
[INFO] Gathered hibernate-configuration (turn on debugging for details): | |
[INFO] hibernate.connection.username = username | |
[INFO] hibernate.connection.password = password | |
[INFO] hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect | |
[INFO] hibernate.connection.url = jdbc:mysql://localhost/game_manager?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC | |
[INFO] hibernate.hbm2dll.create_namespaces = false | |
[INFO] hibernate.connection.driver_class = com.mysql.jdbc.Driver |