-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29669 from KyleAure/jakarta-data-todos-3
- Loading branch information
Showing
6 changed files
with
60 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -959,7 +959,7 @@ public void testEmbeddable() { | |
added.stream().map(a -> a.id).collect(Collectors.toSet())); | ||
|
||
assertArrayEquals(new ShippingAddress[] { a4, a2 }, | ||
shippingAddresses.findByStreetNameOrderByHouseNumber("4th St SE"), | ||
shippingAddresses.findByStreetAddress_streetNameOrderByStreetAddress_houseNumber("4th St SE"), | ||
Comparator.<ShippingAddress, Long> comparing(o -> o.id) | ||
.thenComparing(Comparator.<ShippingAddress, String> comparing(o -> o.city)) | ||
.thenComparing(Comparator.<ShippingAddress, String> comparing(o -> o.state)) | ||
|
@@ -968,7 +968,7 @@ Comparator.<ShippingAddress, Long> comparing(o -> o.id) | |
.thenComparing(Comparator.<ShippingAddress, Integer> comparing(o -> o.zipCode))); | ||
|
||
assertIterableEquals(List.of("200 1st Ave SW", "151 4th St SE", "201 4th St SE"), | ||
Stream.of(shippingAddresses.findByHouseNumberBetweenOrderByStreetNameAscHouseNumber(150, 250)) | ||
Stream.of(shippingAddresses.findByStreetAddress_houseNumberBetweenOrderByStreetAddress_streetNameAscStreetAddress_houseNumber(150, 250)) | ||
.map(a -> a.houseNumber + " " + a.streetName) | ||
.collect(Collectors.toList())); | ||
|
||
|
@@ -987,7 +987,7 @@ Comparator.<ShippingAddress, Long> comparing(o -> o.id) | |
// assertEquals(a1.streetAddress.streetName, a.streetAddress.streetName); | ||
// assertEquals(a1.streetAddress.recipientInfo, a.streetAddress.recipientInfo); | ||
|
||
// assertEquals(3L, shippingAddresses.countByRecipientInfoEmpty()); | ||
// assertEquals(3L, shippingAddresses.countByStreetAddressRecipientInfoEmpty()); | ||
|
||
// [EclipseLink-4002] Internal Exception: java.sql.SQLIntegrityConstraintViolationException: | ||
// DELETE on table 'SHIPPINGADDRESS' caused a violation of foreign key constraint 'SHPPNGSHPPNGDDRSSD' for key (1001) | ||
|
@@ -1084,7 +1084,7 @@ public void testEmbeddableCollection() { | |
@Test | ||
public void testEmbeddableDepth1() { | ||
assertIterableEquals(List.of("Olmsted Medical", "Mayo Clinic", "Home Federal Savings Bank", "Custom Alarm"), | ||
businesses.findByLatitudeBetweenOrderByLongitudeDesc(44.0f, 44.03f) | ||
businesses.findByLocationLatitudeBetweenOrderByLocationLongitudeDesc(44.0f, 44.03f) | ||
.stream() | ||
.map(b -> b.name) | ||
.collect(Collectors.toList())); | ||
|
@@ -1098,15 +1098,15 @@ public void testEmbeddableDepth2() { | |
CursoredPage<Business> page; | ||
List<Integer> zipCodes = List.of(55906, 55902, 55901, 55976, 55905); | ||
|
||
page = businesses.findByZipIn(zipCodes, PageRequest.ofSize(4).withoutTotal()); | ||
page = businesses.findByLocationAddressZipIn(zipCodes, PageRequest.ofSize(4).withoutTotal()); | ||
|
||
assertIterableEquals(List.of(345, 1421, 1016, 1600), | ||
page | ||
.stream() | ||
.map(b -> b.location.address.houseNum) | ||
.collect(Collectors.toList())); | ||
|
||
page = businesses.findByZipIn(zipCodes, page.nextPageRequest()); | ||
page = businesses.findByLocationAddressZipIn(zipCodes, page.nextPageRequest()); | ||
|
||
assertIterableEquals(List.of(2800, 2960, 3100, 3428), | ||
page | ||
|
@@ -1117,7 +1117,7 @@ public void testEmbeddableDepth2() { | |
assertEquals(2L, page.pageRequest().page()); | ||
assertEquals(4, page.pageRequest().size()); | ||
|
||
page = businesses.findByZipIn(zipCodes, page.nextPageRequest()); | ||
page = businesses.findByLocationAddressZipIn(zipCodes, page.nextPageRequest()); | ||
|
||
assertIterableEquals(List.of(5201, 1661, 3706, 200), | ||
page | ||
|
@@ -1127,7 +1127,7 @@ public void testEmbeddableDepth2() { | |
|
||
assertEquals(3, page.pageRequest().page()); | ||
|
||
page = businesses.findByZipIn(zipCodes, page.nextPageRequest()); | ||
page = businesses.findByLocationAddressZipIn(zipCodes, page.nextPageRequest()); | ||
|
||
assertIterableEquals(List.of(1402, 3008), | ||
page | ||
|
@@ -1139,7 +1139,7 @@ public void testEmbeddableDepth2() { | |
assertEquals(4, page.pageRequest().page()); | ||
assertEquals(false, page.hasNext()); | ||
|
||
page = businesses.findByZipIn(zipCodes, page.previousPageRequest()); | ||
page = businesses.findByLocationAddressZipIn(zipCodes, page.previousPageRequest()); | ||
|
||
assertIterableEquals(List.of(5201, 1661, 3706, 200), | ||
page | ||
|
@@ -1257,7 +1257,7 @@ public void testEmbeddableTypeAsResult() { | |
"NW Lakeridge Pl", | ||
"NW Members Parkway", | ||
"W Highway 14"), | ||
businesses.findByZip(55901) | ||
businesses.findByLocationAddressZip(55901) | ||
.map(loc -> loc.address.street.direction + " " + loc.address.street.name) | ||
.collect(Collectors.toList())); | ||
} | ||
|
@@ -1273,7 +1273,7 @@ public void testEmbeddableTypeAsResultDepth3() { | |
"SW 1st St", | ||
"SW Enterprise Dr", | ||
"SW Greenview Dr"), | ||
businesses.findByZipNotAndCity(55901, "Rochester") | ||
businesses.findByLocationAddressZipNotAndLocationAddressCity(55901, "Rochester") | ||
.map(street -> street.direction + " " + street.name) | ||
.collect(Collectors.toList())); | ||
} | ||
|
@@ -2282,7 +2282,7 @@ public void testInheritance() { | |
assertEquals("37th St NW", a.streetAddress.streetName); | ||
assertEquals(55901, a.zipCode); | ||
|
||
WorkAddress[] secondFloorOfficesOn37th = shippingAddresses.findByStreetNameAndFloorNumber("37th St NW", 2); | ||
WorkAddress[] secondFloorOfficesOn37th = shippingAddresses.findByStreetAddress_streetNameAndFloorNumber("37th St NW", 2); | ||
|
||
assertArrayEquals(new WorkAddress[] { work }, secondFloorOfficesOn37th, | ||
Comparator.<WorkAddress, Long> comparing(o -> o.id) | ||
|
@@ -2294,7 +2294,7 @@ Comparator.<WorkAddress, Long> comparing(o -> o.id) | |
.thenComparing(Comparator.<WorkAddress, Integer> comparing(o -> o.streetAddress.houseNumber)) | ||
.thenComparing(Comparator.<WorkAddress, Integer> comparing(o -> o.zipCode))); | ||
|
||
ShippingAddress[] found = shippingAddresses.findByStreetNameOrderByHouseNumber("37th St NW"); | ||
ShippingAddress[] found = shippingAddresses.findByStreetAddress_streetNameOrderByStreetAddress_houseNumber("37th St NW"); | ||
|
||
assertArrayEquals(new ShippingAddress[] { work }, found, | ||
Comparator.<ShippingAddress, Long> comparing(o -> o.id) | ||
|
@@ -2306,7 +2306,7 @@ Comparator.<ShippingAddress, Long> comparing(o -> o.id) | |
.thenComparing(Comparator.<ShippingAddress, Integer> comparing(o -> o.streetAddress.houseNumber)) | ||
.thenComparing(Comparator.<ShippingAddress, Integer> comparing(o -> o.zipCode))); | ||
|
||
StreetAddress[] streetAddresses = shippingAddresses.findByHouseNumberBetweenOrderByStreetNameAscHouseNumber(1000, 3000); | ||
StreetAddress[] streetAddresses = shippingAddresses.findByStreetAddress_houseNumberBetweenOrderByStreetAddress_streetNameAscStreetAddress_houseNumber(1000, 3000); | ||
|
||
assertArrayEquals(new StreetAddress[] { work.streetAddress, home.streetAddress }, streetAddresses, | ||
Comparator.<StreetAddress, Integer> comparing(o -> o.houseNumber) | ||
|
@@ -2820,7 +2820,7 @@ public void testOneToManyCustomJoinQuery() { | |
// TODO Could this be achieved with @Select? | ||
public void testOneToManyReturnsCombinedCollectionFromMany() { | ||
|
||
List<Long> cardNumbers = customers.findCardsByEmailEndsWith("[email protected]") | ||
List<Long> cardNumbers = customers.findCardsByDebtorEmailEndsWith("[email protected]") | ||
.map(card -> card.number) | ||
.collect(Collectors.toList()); | ||
|
||
|
@@ -2837,7 +2837,7 @@ public void testOneToManyReturnsCombinedCollectionFromMany() { | |
*/ | ||
@Test | ||
public void testOneToManyReturnsOneSetOfMany() { | ||
Set<CreditCard> cards = customers.findCardsByCustomerId(9210005); | ||
Set<CreditCard> cards = customers.findCardsByDebtorCustomerId(9210005); | ||
|
||
assertEquals(cards.toString(), 2, cards.size()); | ||
|
||
|
@@ -2900,7 +2900,7 @@ public void testOneToOne() { | |
assertEquals("Oscar TestOneToOne", d.fullName); | ||
|
||
// Query by an attribute of the entity to which OneToOne maps: | ||
d = drivers.findByLicenseNum("T121-200-200-200"); | ||
d = drivers.findByLicense_licenseNum("T121-200-200-200"); | ||
assertEquals("Oliver TestOneToOne", d.fullName); | ||
|
||
// Query by and order by attributes of the entity to which OneToOne maps: | ||
|
@@ -2918,7 +2918,7 @@ public void testOneToOne() { | |
assertIterableEquals(List.of("Minnesota T121-100-100-100", "Minnesota T121-300-300-300", | ||
"Wisconsin T121-500-500-500", "Wisconsin T121-200-200-200", | ||
"Iowa T121-400-400-400"), | ||
drivers.findByFullNameEndsWith(" TestOneToOne") | ||
drivers.findByDriver_fullNameEndsWith(" TestOneToOne") | ||
.map(license -> license.stateName + " " + license.licenseNum) | ||
.collect(Collectors.toList())); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters