Update jpa-api to 2.0-cr-1
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17773 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
694a694d5d
commit
ca85991589
|
@ -44,7 +44,7 @@ public class BasicCriteriaUsageTest extends TestCase {
|
||||||
public void testSimplestCriterias() {
|
public void testSimplestCriterias() {
|
||||||
EntityManager em = getOrCreateEntityManager();
|
EntityManager em = getOrCreateEntityManager();
|
||||||
em.getTransaction().begin();
|
em.getTransaction().begin();
|
||||||
CriteriaQuery criteria = em.getQueryBuilder().createQuery();
|
CriteriaQuery criteria = em.getCriteriaBuilder().createQuery();
|
||||||
criteria.from( Wall.class );
|
criteria.from( Wall.class );
|
||||||
em.getTransaction().commit();
|
em.getTransaction().commit();
|
||||||
em.close();
|
em.close();
|
||||||
|
@ -53,14 +53,14 @@ public class BasicCriteriaUsageTest extends TestCase {
|
||||||
public void testParameterCollection() {
|
public void testParameterCollection() {
|
||||||
EntityManager em = getOrCreateEntityManager();
|
EntityManager em = getOrCreateEntityManager();
|
||||||
em.getTransaction().begin();
|
em.getTransaction().begin();
|
||||||
CriteriaQuery criteria = em.getQueryBuilder().createQuery();
|
CriteriaQuery criteria = em.getCriteriaBuilder().createQuery();
|
||||||
Root<Wall> from = criteria.from( Wall.class );
|
Root<Wall> from = criteria.from( Wall.class );
|
||||||
ParameterExpression param = em.getQueryBuilder().parameter( String.class );
|
ParameterExpression param = em.getCriteriaBuilder().parameter( String.class );
|
||||||
SingularAttribute<? super Wall,?> colorAttribute = em.getMetamodel()
|
SingularAttribute<? super Wall,?> colorAttribute = em.getMetamodel()
|
||||||
.entity( Wall.class )
|
.entity( Wall.class )
|
||||||
.getDeclaredSingularAttribute( "color" );
|
.getDeclaredSingularAttribute( "color" );
|
||||||
assertNotNull( "metamodel returned null singular attribute", colorAttribute );
|
assertNotNull( "metamodel returned null singular attribute", colorAttribute );
|
||||||
Predicate predicate = em.getQueryBuilder().equal( from.get( colorAttribute ), param );
|
Predicate predicate = em.getCriteriaBuilder().equal( from.get( colorAttribute ), param );
|
||||||
criteria.where( predicate );
|
criteria.where( predicate );
|
||||||
assertEquals( 1, criteria.getParameters().size() );
|
assertEquals( 1, criteria.getParameters().size() );
|
||||||
em.getTransaction().commit();
|
em.getTransaction().commit();
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Properties;
|
||||||
import javax.persistence.spi.ClassTransformer;
|
import javax.persistence.spi.ClassTransformer;
|
||||||
import javax.persistence.spi.PersistenceUnitInfo;
|
import javax.persistence.spi.PersistenceUnitInfo;
|
||||||
import javax.persistence.spi.PersistenceUnitTransactionType;
|
import javax.persistence.spi.PersistenceUnitTransactionType;
|
||||||
import javax.persistence.Caching;
|
import javax.persistence.SharedCacheMode;
|
||||||
import javax.persistence.ValidationMode;
|
import javax.persistence.ValidationMode;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public class PersistenceUnitInfoImpl implements PersistenceUnitInfo {
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String PersistenceXMLSchemaVersion() {
|
public String getPersistenceXMLSchemaVersion() {
|
||||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ public class PersistenceUnitInfoImpl implements PersistenceUnitInfo {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Caching getCaching() {
|
public SharedCacheMode getSharedCacheMode() {
|
||||||
//FIXME
|
//FIXME
|
||||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ public class MetadataTest extends TestCase {
|
||||||
assertEquals( Bindable.BindableType.PLURAL_ATTRIBUTE, rooms.getBindableType() );
|
assertEquals( Bindable.BindableType.PLURAL_ATTRIBUTE, rooms.getBindableType() );
|
||||||
assertEquals( Set.class, rooms.getJavaType() );
|
assertEquals( Set.class, rooms.getJavaType() );
|
||||||
assertEquals( PluralAttribute.CollectionType.SET, rooms.getCollectionType() );
|
assertEquals( PluralAttribute.CollectionType.SET, rooms.getCollectionType() );
|
||||||
assertEquals( 3, entityType.getDeclaredCollections().size() );
|
assertEquals( 3, entityType.getDeclaredPluralAttributes().size() );
|
||||||
assertEquals( Type.PersistenceType.EMBEDDABLE, rooms.getElementType().getPersistenceType() );
|
assertEquals( Type.PersistenceType.EMBEDDABLE, rooms.getElementType().getPersistenceType() );
|
||||||
|
|
||||||
final MapAttribute<House,String,Room> roomsByName = entityType.getDeclaredMap(
|
final MapAttribute<House,String,Room> roomsByName = entityType.getDeclaredMap(
|
||||||
|
|
|
@ -175,7 +175,7 @@ public class JarVisitorTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see EJB-230
|
* EJB-230
|
||||||
*/
|
*/
|
||||||
public void testDuplicateFilterExplodedJarExpected() throws Exception {
|
public void testDuplicateFilterExplodedJarExpected() throws Exception {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue