Fix JDO test

This commit is contained in:
Timo Westkämper 2014-04-30 11:08:27 +03:00
parent 35a6bee2d2
commit 662837154f
2 changed files with 23 additions and 19 deletions

View File

@ -13,19 +13,10 @@
*/
package com.mysema.query.jdo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import java.sql.SQLException;
import java.util.List;
import javax.jdo.PersistenceManager;
import javax.jdo.Transaction;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import java.sql.SQLException;
import java.util.List;
import com.mysema.query.NonUniqueResultException;
import com.mysema.query.SearchResults;
@ -40,6 +31,10 @@ import com.mysema.query.types.ConstructorExpression;
import com.mysema.query.types.Expression;
import com.mysema.query.types.SubQueryExpression;
import com.mysema.query.types.expr.BooleanExpression;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;
public class JDOSQLQueryTest extends AbstractJDOTest{

View File

@ -13,18 +13,13 @@
*/
package com.mysema.query.jdo.test.domain.sql;
import static com.mysema.query.types.PathMetadataFactory.forVariable;
import com.mysema.query.sql.ColumnMetadata;
import com.mysema.query.sql.ForeignKey;
import com.mysema.query.sql.PrimaryKey;
import com.mysema.query.sql.RelationalPathBase;
import com.mysema.query.types.PathMetadata;
import com.mysema.query.types.path.BeanPath;
import com.mysema.query.types.path.DatePath;
import com.mysema.query.types.path.DateTimePath;
import com.mysema.query.types.path.NumberPath;
import com.mysema.query.types.path.StringPath;
import com.mysema.query.types.path.TimePath;
import com.mysema.query.types.path.*;
import static com.mysema.query.types.PathMetadataFactory.forVariable;
/**
@ -63,14 +58,28 @@ public class SProduct extends RelationalPathBase<SProduct> {
public SProduct(String variable) {
super(SProduct.class, forVariable(variable), null, "PRODUCT");
addMetadata();
}
public SProduct(BeanPath<? extends SProduct> entity) {
super(entity.getType(),entity.getMetadata(), null, "PRODUCT");
addMetadata();
}
public SProduct(PathMetadata<?> metadata) {
super(SProduct.class, metadata, null, "PRODUCT");
addMetadata();
}
public void addMetadata() {
addMetadata(amount, ColumnMetadata.named("AMOUNT"));
addMetadata(datefield, ColumnMetadata.named("DATEFIELD"));
addMetadata(description, ColumnMetadata.named("DESCRIPTION"));
addMetadata(name, ColumnMetadata.named("NAME"));
addMetadata(price, ColumnMetadata.named("PRICE"));
addMetadata(productId, ColumnMetadata.named("PRODUCT_ID"));
addMetadata(publicationdate, ColumnMetadata.named("PUBLICATIONDATE"));
addMetadata(timefield, ColumnMetadata.named("TIMEFIELD"));
}
}