HHH-7917 : Add support for ordered sets
This commit is contained in:
parent
bf5fabd64a
commit
413ca60475
|
@ -475,7 +475,9 @@ class HibernateTypeHelper {
|
|||
pluralAttributeBinding.getComparator()
|
||||
);
|
||||
}
|
||||
// TODO: else if ( pluralAttributeBinding.hasOrder() ) { orderedSet... }
|
||||
else if ( pluralAttributeBinding.getOrderBy() != null ) {
|
||||
return typeFactory().orderedSet( role, propertyRef );
|
||||
}
|
||||
else {
|
||||
return typeFactory().set( role, propertyRef );
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ import org.hibernate.Transaction;
|
|||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class OrderByTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
public void testOrderByName() throws Exception {
|
||||
|
@ -47,17 +46,14 @@ public class OrderByTest extends BaseCoreFunctionalTestCase {
|
|||
Widgets widget = new Widgets();
|
||||
widget.setName("hammer");
|
||||
set.add(widget);
|
||||
s.persist(widget);
|
||||
|
||||
widget = new Widgets();
|
||||
widget.setName("axel");
|
||||
set.add(widget);
|
||||
s.persist(widget);
|
||||
|
||||
widget = new Widgets();
|
||||
widget.setName("screwdriver");
|
||||
set.add(widget);
|
||||
s.persist(widget);
|
||||
|
||||
p.setWidgets(set);
|
||||
s.persist(p);
|
||||
|
|
|
@ -4,6 +4,7 @@ import javax.persistence.ElementCollection;
|
|||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OrderBy;
|
||||
|
||||
@SuppressWarnings({"unchecked", "serial"})
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
package org.hibernate.test.annotations.collectionelement;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Embeddable;
|
||||
|
||||
@Entity
|
||||
@Embeddable
|
||||
public class Widgets {
|
||||
private String name;
|
||||
private int id;
|
||||
|
||||
public Widgets() {
|
||||
|
||||
|
@ -19,15 +16,4 @@ public class Widgets {
|
|||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ public class OrderByTest extends BaseCoreFunctionalTestCase {
|
|||
|
||||
@Test
|
||||
@SuppressWarnings( {"unchecked"})
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public void testOrderBy() {
|
||||
Search s = new Search("Hibernate");
|
||||
s.getSearchResults().add("jboss.com");
|
||||
|
|
Loading…
Reference in New Issue