Move annotations.idmanytoone tests and fix property lookup of identifierMapper
This commit is contained in:
parent
7b58e700db
commit
eaba3acc20
|
@ -526,13 +526,17 @@ public abstract class PersistentClass implements AttributeContainer, Serializabl
|
|||
}
|
||||
|
||||
public Property getProperty(String propertyName) throws MappingException {
|
||||
Iterator<Property> iter = getPropertyClosureIterator();
|
||||
Property identifierProperty = getIdentifierProperty();
|
||||
if ( identifierProperty != null
|
||||
&& identifierProperty.getName().equals( StringHelper.root( propertyName ) ) ) {
|
||||
return identifierProperty;
|
||||
}
|
||||
else {
|
||||
Iterator<Property> iter = getPropertyClosureIterator();
|
||||
Component identifierMapper = getIdentifierMapper();
|
||||
if ( identifierMapper != null ) {
|
||||
iter = new JoinedIterator<>( identifierMapper.getPropertyIterator(), iter );
|
||||
}
|
||||
return getProperty( propertyName, iter );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1202,8 +1202,9 @@ public class MappingModelCreationHelper {
|
|||
// A value that came from the annotation model is already sorted appropriately
|
||||
// so we use an "identity mapping"
|
||||
else {
|
||||
final int[] propertyReordering = new int[componentType.getSubtypes().length];
|
||||
for ( int i = 0; i < propertyReordering.length; i++ ) {
|
||||
final int columnSpan = componentType.getColumnSpan( creationProcess.getCreationContext().getBootModel() );
|
||||
final int[] propertyReordering = new int[columnSpan];
|
||||
for ( int i = 0; i < columnSpan; i++ ) {
|
||||
propertyReordering[i] = i;
|
||||
}
|
||||
return propertyReordering;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$Id$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import javax.persistence.CascadeType;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$Id$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.persistence.Entity;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$Id$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
|
@ -4,14 +4,13 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.IdClass;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$Id$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import javax.persistence.Entity;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
|
@ -64,7 +64,7 @@ public class IdManyToOneTest extends BaseCoreFunctionalTestCase {
|
|||
Join<Object, Object> students = root.join( "students", JoinType.INNER );
|
||||
Join<Object, Object> student = students.join( "student", JoinType.INNER );
|
||||
criteria.where( criteriaBuilder.equal( student.get( "name" ), "Foo" ) );
|
||||
session.createQuery( criteria ).list();
|
||||
s.createQuery( criteria ).list();
|
||||
// Criteria criteria = s.createCriteria( Course.class );
|
||||
// criteria.createCriteria( "students" ).createCriteria( "student" ).add( Restrictions.eq( "name", "Foo" ) );
|
||||
// criteria.list();
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$Id$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$Id$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import javax.persistence.Entity;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$Id$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$Id$
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.annotations.idmanytoone;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
import java.util.List;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigInteger;
|
||||
import javax.persistence.Entity;
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
|
||||
import org.junit.Test;
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||
*/
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
|
||||
import org.junit.Test;
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.IdClass;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.persistence.JoinColumn;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
import java.math.BigInteger;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
import java.util.List;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
import java.io.Serializable;
|
||||
import javax.persistence.Embeddable;
|
||||
import javax.persistence.JoinColumn;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
import java.math.BigInteger;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
//$
|
||||
package org.hibernate.test.annotations.idmanytoone.alphabetical;
|
||||
package org.hibernate.orm.test.annotations.idmanytoone.alphabetical;
|
||||
import java.math.BigInteger;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
Loading…
Reference in New Issue