Skip to content

Commit 75b153d

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 df69890 commit 75b153d

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
@@ -166,10 +166,18 @@
166166
<plugin>
167167
<artifactId>maven-invoker-plugin</artifactId>
168168
<version>${maven-invoker-plugin.version}</version>
169+
<dependencies>
170+
<dependency>
171+
<groupId>com.h2database</groupId>
172+
<artifactId>h2</artifactId>
173+
<version>${h2.version}</version>
174+
</dependency>
175+
</dependencies>
169176
<configuration>
170177
<debug>true</debug>
171178
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
172179
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
180+
<preBuildHookScript>setup</preBuildHookScript>
173181
<postBuildHookScript>verify</postBuildHookScript>
174182
</configuration>
175183
<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)