Skip to content

Commit c3058dd

Browse files
committed
merge ebean
2 parents cd4ede3 + ec617d1 commit c3058dd

File tree

4 files changed

+61
-63
lines changed

4 files changed

+61
-63
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* [S2JDBC](demo-s2jdbc)
1414
* [DBFlute](demo-dbflute)
1515
* [Iciql](demo-iciql)
16+
* [Ebean](demo-ebean)
1617

1718
Pull Requests Welcome :)
1819

demo-ebean/pom.xml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@
3434
</dependency>
3535

3636
<dependency>
37-
<groupId>org.avaje.ebeanorm</groupId>
38-
<artifactId>avaje-ebeanorm</artifactId>
39-
<version>7.18.1</version>
37+
<groupId>org.avaje.ebeanorm</groupId>
38+
<artifactId>avaje-ebeanorm</artifactId>
39+
<version>7.18.1</version>
4040
</dependency>
4141
<dependency>
42-
<groupId>org.avaje.ebeanorm</groupId>
43-
<artifactId>querybean-generator</artifactId>
44-
<version>2.3.1</version>
45-
<scope>provided</scope>
42+
<groupId>org.avaje.ebeanorm</groupId>
43+
<artifactId>querybean-generator</artifactId>
44+
<version>2.3.1</version>
45+
<scope>provided</scope>
4646
</dependency>
4747
<dependency>
48-
<groupId>org.avaje.ebeanorm</groupId>
49-
<artifactId>avaje-ebeanorm-querybean</artifactId>
50-
<version>7.15.1</version>
48+
<groupId>org.avaje.ebeanorm</groupId>
49+
<artifactId>avaje-ebeanorm-querybean</artifactId>
50+
<version>7.15.1</version>
5151
</dependency>
5252

5353
<dependency>
@@ -62,11 +62,11 @@
6262
<scope>test</scope>
6363
</dependency>
6464
<dependency>
65-
<groupId>org.avaje.composite</groupId>
66-
<artifactId>avaje-composite-testing-ebean</artifactId>
67-
<version>4.1</version>
68-
<type>pom</type>
69-
<scope>test</scope>
65+
<groupId>org.avaje.composite</groupId>
66+
<artifactId>avaje-composite-testing-ebean</artifactId>
67+
<version>4.1</version>
68+
<type>pom</type>
69+
<scope>test</scope>
7070
</dependency>
7171
</dependencies>
7272

@@ -96,7 +96,6 @@
9696
</executions>
9797
</plugin>
9898

99-
10099
<plugin>
101100
<groupId>org.avaje.ebeanorm</groupId>
102101
<artifactId>querybean-maven-plugin</artifactId>
@@ -125,8 +124,6 @@
125124
</execution>
126125
</executions>
127126
</plugin>
128-
129-
130127
</plugins>
131128
</build>
132129

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
package com.example;
2-
3-
import javax.sql.DataSource;
4-
5-
import org.springframework.beans.factory.FactoryBean;
6-
import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
7-
import org.springframework.stereotype.Component;
8-
9-
import com.avaje.ebean.EbeanServer;
10-
import com.avaje.ebean.EbeanServerFactory;
11-
import com.avaje.ebean.config.ServerConfig;
12-
13-
@Component
14-
public class EbeanFactroyBean implements FactoryBean<EbeanServer> {
15-
16-
private final DataSource dataSource;
17-
18-
public EbeanFactroyBean(DataSource dataSource) {
19-
this.dataSource = new TransactionAwareDataSourceProxy(dataSource);
20-
}
21-
22-
@Override
23-
public EbeanServer getObject() throws Exception {
24-
25-
ServerConfig config = new ServerConfig();
26-
config.setName("db");
27-
config.setDataSource(dataSource);
28-
config.setDefaultServer(true);
29-
config.setRegister(true);
30-
31-
return EbeanServerFactory.create(config);
32-
}
33-
34-
@Override
35-
public Class<?> getObjectType() {
36-
return EbeanServer.class;
37-
}
38-
39-
@Override
40-
public boolean isSingleton() {
41-
return true;
42-
}
43-
}
1+
package com.example;
2+
3+
import javax.sql.DataSource;
4+
5+
import org.springframework.beans.factory.FactoryBean;
6+
import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
7+
import org.springframework.stereotype.Component;
8+
9+
import com.avaje.ebean.EbeanServer;
10+
import com.avaje.ebean.EbeanServerFactory;
11+
import com.avaje.ebean.config.ServerConfig;
12+
13+
@Component
14+
public class EbeanFactroyBean implements FactoryBean<EbeanServer> {
15+
16+
private final DataSource dataSource;
17+
18+
public EbeanFactroyBean(DataSource dataSource) {
19+
this.dataSource = new TransactionAwareDataSourceProxy(dataSource);
20+
}
21+
22+
@Override
23+
public EbeanServer getObject() throws Exception {
24+
25+
ServerConfig config = new ServerConfig();
26+
config.setName("default");
27+
config.setDataSource(dataSource);
28+
config.setDefaultServer(true);
29+
config.setRegister(true);
30+
31+
return EbeanServerFactory.create(config);
32+
}
33+
34+
@Override
35+
public Class<?> getObjectType() {
36+
return EbeanServer.class;
37+
}
38+
39+
@Override
40+
public boolean isSingleton() {
41+
return true;
42+
}
43+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
logging.level.org.avaje.ebean.SQL=DEBUG
2-
logging.level.org.avaje.ebean.TXN=DEBUG
1+
logging.level.org.avaje.ebean.SQL=DEBUG
2+
logging.level.org.avaje.ebean.TXN=DEBUG

0 commit comments

Comments
 (0)