File tree 5 files changed +16
-6
lines changed
java/io/openliberty/sample/data
5 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 7
7
public class Package {
8
8
9
9
@ Id
10
- public int id ;
10
+ public Integer id ;
11
11
12
12
public String destination ;
13
13
14
14
public Package () {
15
15
16
16
}
17
17
18
- public Package (int id , String destination ) {
18
+ public Package (Integer id , String destination ) {
19
19
this .id = id ;
20
20
this .destination = destination ;
21
21
}
Original file line number Diff line number Diff line change 1
- package io .openliberty .sample .rest ;
1
+ package io .openliberty .sample .data ;
2
2
3
3
import jakarta .ws .rs .ApplicationPath ;
4
4
import jakarta .ws .rs .core .Application ;
Original file line number Diff line number Diff line change 1
- package io .openliberty .sample .rest ;
1
+ package io .openliberty .sample .data ;
2
2
3
- import io .openliberty .sample .data .Packages ;
4
- import io .openliberty .sample .data .Package ;
3
+ import jakarta .annotation .Resource ;
5
4
import jakarta .enterprise .context .ApplicationScoped ;
6
5
import jakarta .inject .Inject ;
6
+ import jakarta .transaction .UserTransaction ;
7
7
import jakarta .ws .rs .GET ;
8
8
import jakarta .ws .rs .Path ;
9
9
import jakarta .ws .rs .PathParam ;
@@ -17,6 +17,9 @@ public class PackagesService {
17
17
@ Inject
18
18
Packages packages ;
19
19
20
+ @ Resource
21
+ UserTransaction tran ;
22
+
20
23
@ GET //For testing eventually change to POST
21
24
@ Path ("/{id}" )
22
25
public void add (@ PathParam ("id" ) Integer id ) {
Original file line number Diff line number Diff line change 21
21
<logging traceSpecification =" *=info:data=all:org.hibernate=all:persistenceService=all" />
22
22
23
23
24
+
24
25
<featureManager >
25
26
<feature >dataContainer-1.0</feature >
26
27
<feature >persistenceContainer-3.2</feature >
30
31
<fileset dir =" ${server.config.dir}/lib/derby" includes =" *.jar" />
31
32
</library >
32
33
34
+
33
35
<library id =" hibernate" >
34
36
<fileset dir =" ${server.config.dir}/lib/hibernate" includes =" *.jar" />
35
37
</library >
36
38
39
+
37
40
<dataSource id =" DefaultDataSource" >
38
41
<jdbcDriver libraryRef =" derby" />
39
42
<properties .derby.embedded databaseName =" memory:testDB" createDatabase =" create" />
Original file line number Diff line number Diff line change 9
9
<properties >
10
10
<property name =" jakarta.persistence.schema-generation.database.action" value =" create" />
11
11
<property name =" hibernate.show_sql" value =" true" />
12
+
12
13
<property name =" hibernate.allow_update_outside_transaction" value =" true" />
13
14
<property name =" hibernate.enhancer.enableDirtyTracking" value =" false" />
14
15
<property name =" hibernate.enhancer.enableLazyInitialization" value =" false" />
16
+
15
17
<property name =" hibernate.dialect" value =" org.hibernate.community.dialect.DerbyDialect" />
18
+ <property name =" hibernate.archive.autodetection" value =" class, hbm" />
19
+
16
20
</properties >
17
21
</persistence-unit >
18
22
You can’t perform that action at this time.
0 commit comments