mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Changes to support the preceeding merges
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.avaje.tests.basic;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
@@ -11,11 +13,13 @@ import com.avaje.ebean.Query;
|
||||
import com.avaje.ebean.SqlFutureList;
|
||||
import com.avaje.ebean.SqlQuery;
|
||||
import com.avaje.ebean.SqlRow;
|
||||
import com.avaje.ebean.Transaction;
|
||||
import com.avaje.ebean.config.DataSourceConfig;
|
||||
import com.avaje.ebean.config.ServerConfig;
|
||||
import com.avaje.tests.model.basic.Order;
|
||||
import com.avaje.tests.model.basic.ResetBasicData;
|
||||
import com.avaje.tests.model.basic.TOne;
|
||||
import com.mysql.jdbc.PreparedStatement;
|
||||
|
||||
public class MainFutureList {
|
||||
|
||||
@@ -26,6 +30,33 @@ public class MainFutureList {
|
||||
//testOrmFuture();
|
||||
}
|
||||
|
||||
public void executeDDL(EbeanServer server, String ddl) {
|
||||
|
||||
Transaction t = server.createTransaction();
|
||||
try {
|
||||
Connection connection = t.getConnection()
|
||||
;
|
||||
|
||||
|
||||
} finally {
|
||||
t.end();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void executeStmt(Connection c, String ddl) throws SQLException {
|
||||
java.sql.PreparedStatement pstmt = null;
|
||||
try {
|
||||
pstmt = c.prepareStatement(ddl);
|
||||
pstmt.execute();
|
||||
|
||||
} finally {
|
||||
if (pstmt != null) {
|
||||
pstmt.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static EbeanServer createEbeanServer(boolean primary) {
|
||||
|
||||
if (primary){
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.avaje.tests.basic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.avaje.ebean.BeanState;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.tests.model.basic.Customer;
|
||||
import com.avaje.tests.model.basic.Order;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
||||
public class TestEnhancementCollectionInitialisation extends TestCase {
|
||||
|
||||
public void testListInitialisation() {
|
||||
|
||||
Customer customer = new Customer();
|
||||
BeanState beanState = Ebean.getBeanState(customer);
|
||||
if (beanState != null) {
|
||||
List<Order> orders = customer.getOrders();
|
||||
assertNotNull(orders);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user