Skip to content

Commit 0d05967

Browse files
committed
HBX-3000: Maven GenerateJava Mojo should generate annotated entities by default
- Add pre-build script 'setup.bsh' for GenerateJavaWithAnnotations to create a database - Add post-build script 'verify.bsh' for GenerateJavaWithAnnotations Signed-off-by: Koen Aers <[email protected]>
1 parent bd59271 commit 0d05967

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

maven/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,18 @@
180180
<plugin>
181181
<artifactId>maven-invoker-plugin</artifactId>
182182
<version>${maven-invoker-plugin.version}</version>
183+
<dependencies>
184+
<dependency>
185+
<groupId>com.h2database</groupId>
186+
<artifactId>h2</artifactId>
187+
<version>${h2.version}</version>
188+
</dependency>
189+
</dependencies>
183190
<configuration>
184191
<debug>true</debug>
185192
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
186193
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
194+
<preBuildHookScript>setup</preBuildHookScript>
187195
<postBuildHookScript>verify</postBuildHookScript>
188196
</configuration>
189197
<executions>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import java.sql.DriverManager;
2+
import java.sql.Connection;
3+
4+
String JDBC_CONNECTION = "jdbc:h2:mem:test";
5+
String CREATE_PERSON_TABLE = "create table PERSON (ID int not null, NAME varchar(20), primary key (ID))";
6+
7+
DriverManager
8+
.getConnection(JDBC_CONNECTION)
9+
.createStatement()
10+
.execute(CREATE_PERSON_TABLE);
11+
12+
System.out.println("Database created!");
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
System.out.println("Hello from 'verify.bsh'");

0 commit comments

Comments
 (0)