HHH-11526 - Documentation for custom collection types
This commit is contained in:
parent
c87253575d
commit
6ed1303349
|
@ -77,7 +77,7 @@ public class QueueTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
@CollectionType( type = "org.hibernate.userguide.collections.type.QueueType")
|
@CollectionType( type = "org.hibernate.userguide.collections.type.QueueType")
|
||||||
private Collection<Phone> phones = new LinkedList<>();
|
private Collection<Phone> phones = new LinkedList<>();
|
||||||
|
|
||||||
//Getters and setters are omitted for brevity
|
//Constructors are omitted for brevity
|
||||||
|
|
||||||
//end::collections-custom-collection-mapping-example[]
|
//end::collections-custom-collection-mapping-example[]
|
||||||
|
|
||||||
|
@ -88,10 +88,10 @@ public class QueueTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//tag::collections-custom-collection-mapping-example[]
|
||||||
public Queue<Phone> getPhones() {
|
public Queue<Phone> getPhones() {
|
||||||
return (Queue<Phone>) phones;
|
return (Queue<Phone>) phones;
|
||||||
}
|
}
|
||||||
//tag::collections-custom-collection-mapping-example[]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Entity(name = "Phone")
|
@Entity(name = "Phone")
|
||||||
|
@ -131,6 +131,7 @@ public class QueueTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//tag::collections-custom-collection-mapping-example[]
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Phone o) {
|
public int compareTo(Phone o) {
|
||||||
return number.compareTo( o.getNumber() );
|
return number.compareTo( o.getNumber() );
|
||||||
|
@ -152,7 +153,6 @@ public class QueueTest extends BaseEntityManagerFunctionalTestCase {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash( number );
|
return Objects.hash( number );
|
||||||
}
|
}
|
||||||
//tag::collections-custom-collection-mapping-example[]
|
|
||||||
}
|
}
|
||||||
//end::collections-custom-collection-mapping-example[]
|
//end::collections-custom-collection-mapping-example[]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue