Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import jakarta.persistence.Table;
import java.math.BigDecimal;
import java.sql.SQLFeatureNotSupportedException;
import java.time.Instant;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
Expand Down Expand Up @@ -94,6 +95,7 @@ void testArrayAndCollectionValues() {
new String[] {null, "str"},
new BigDecimal[] {null, BigDecimal.valueOf(10.1)},
new ObjectId[] {new ObjectId("000000000000000000000001"), null},
new Instant[] {Instant.parse("2007-12-03T10:15:30Z"), null},
new StructAggregateEmbeddableIntegrationTests.Single[] {
new StructAggregateEmbeddableIntegrationTests.Single(1), null
},
Expand All @@ -105,6 +107,7 @@ void testArrayAndCollectionValues() {
asList("str", null),
asList(BigDecimal.valueOf(10.1), null),
asList(null, new ObjectId("000000000000000000000001")),
asList(Instant.parse("2007-12-03T10:15:30Z"), null),
asList(new StructAggregateEmbeddableIntegrationTests.Single(1), null));
sessionFactoryScope.inTransaction(session -> session.persist(item));
assertCollectionContainsExactly(
Expand All @@ -125,6 +128,7 @@ void testArrayAndCollectionValues() {
strings: [null, "str"],
bigDecimals: [null, {$numberDecimal: "10.1"}],
objectIds: [{$oid: "000000000000000000000001"}, null],
instants: [{"$date": "2007-12-03T10:15:30Z"}, null],
structAggregateEmbeddables: [{a: 1}, null],
charsCollection: ["s", "t", null, "r"],
intsCollection: [null, 5],
Expand All @@ -134,6 +138,7 @@ void testArrayAndCollectionValues() {
stringsCollection: ["str", null],
bigDecimalsCollection: [{$numberDecimal: "10.1"}, null],
objectIdsCollection: [null, {$oid: "000000000000000000000001"}],
instantsCollection: [{"$date": "2007-12-03T10:15:30Z"}, null],
structAggregateEmbeddablesCollection: [{a: 1}, null]
}
""");
Expand Down Expand Up @@ -167,6 +172,7 @@ void testArrayAndCollectionValues() {
strings: [null, "str"],
bigDecimals: [null, {$numberDecimal: "10.1"}],
objectIds: [{$oid: "000000000000000000000002"}, null],
instants: [{"$date": "2007-12-03T10:15:30Z"}, null],
structAggregateEmbeddables: [{a: 1}, null],
charsCollection: ["s", "t", null, "r"],
intsCollection: [null, 5],
Expand All @@ -176,6 +182,7 @@ void testArrayAndCollectionValues() {
stringsCollection: ["str", null],
bigDecimalsCollection: [{$numberDecimal: "10.1"}, null],
objectIdsCollection: [null, {$oid: "000000000000000000000001"}],
instantsCollection: [{"$date": "2007-12-03T10:15:30Z"}, null],
structAggregateEmbeddablesCollection: [{a: 1}, null]
}
""");
Expand All @@ -202,6 +209,7 @@ void testArrayAndCollectionEmptyValues() {
new String[0],
new BigDecimal[0],
new ObjectId[0],
new Instant[0],
new StructAggregateEmbeddableIntegrationTests.Single[0],
List.of(),
List.of(),
Expand All @@ -211,6 +219,7 @@ void testArrayAndCollectionEmptyValues() {
List.of(),
List.of(),
List.of(),
List.of(),
List.of());
sessionFactoryScope.inTransaction(session -> session.persist(item));
assertCollectionContainsExactly(
Expand All @@ -231,6 +240,7 @@ void testArrayAndCollectionEmptyValues() {
strings: [],
bigDecimals: [],
objectIds: [],
instants: [],
structAggregateEmbeddables: [],
charsCollection: [],
intsCollection: [],
Expand All @@ -240,6 +250,7 @@ void testArrayAndCollectionEmptyValues() {
stringsCollection: [],
bigDecimalsCollection: [],
objectIdsCollection: [],
instantsCollection: [],
structAggregateEmbeddablesCollection: []
}
""");
Expand All @@ -252,7 +263,7 @@ void testArrayAndCollectionEmptyValues() {
void testArrayAndCollectionNullValues() {
var item = new ItemWithArrayAndCollectionValues(
1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null);
null, null, null, null, null, null, null, null, null);
sessionFactoryScope.inTransaction(session -> session.persist(item));
assertCollectionContainsExactly(
"""
Expand All @@ -272,6 +283,7 @@ void testArrayAndCollectionNullValues() {
strings: null,
bigDecimals: null,
objectIds: null,
instants: null,
structAggregateEmbeddables: null,
charsCollection: null,
intsCollection: null,
Expand All @@ -281,6 +293,7 @@ void testArrayAndCollectionNullValues() {
stringsCollection: null,
bigDecimalsCollection: null,
objectIdsCollection: null,
instantsCollection: null,
structAggregateEmbeddablesCollection: null
}
""");
Expand All @@ -306,6 +319,7 @@ void testArrayAndCollectionValuesOfStructAggregateEmbeddablesHavingArraysAndColl
new String[] {"str"},
new BigDecimal[] {BigDecimal.valueOf(10.1)},
new ObjectId[] {new ObjectId("000000000000000000000001")},
new Instant[] {Instant.parse("2007-12-03T10:15:30Z")},
new StructAggregateEmbeddableIntegrationTests.Single[] {
new StructAggregateEmbeddableIntegrationTests.Single(1)
},
Expand All @@ -318,6 +332,7 @@ void testArrayAndCollectionValuesOfStructAggregateEmbeddablesHavingArraysAndColl
List.of("str"),
List.of(BigDecimal.valueOf(10.1)),
List.of(new ObjectId("000000000000000000000001")),
List.of(Instant.parse("2007-12-03T10:15:30Z")),
List.of(new StructAggregateEmbeddableIntegrationTests.Single(1)));
var item = new ItemWithArrayAndCollectionValuesOfStructAggregateEmbeddablesHavingArraysAndCollections(
1, new ArraysAndCollections[] {arraysAndCollections}, List.of());
Expand All @@ -341,6 +356,7 @@ void testArrayAndCollectionValuesOfStructAggregateEmbeddablesHavingArraysAndColl
strings: ["str"],
bigDecimals: [{$numberDecimal: "10.1"}],
objectIds: [{$oid: "000000000000000000000001"}],
instants: [{"$date": "2007-12-03T10:15:30Z"}],
structAggregateEmbeddables: [{a: 1}],
charsCollection: ["s", "t", "r"],
intsCollection: [5],
Expand All @@ -350,6 +366,7 @@ void testArrayAndCollectionValuesOfStructAggregateEmbeddablesHavingArraysAndColl
stringsCollection: ["str"],
bigDecimalsCollection: [{$numberDecimal: "10.1"}],
objectIdsCollection: [{$oid: "000000000000000000000001"}],
instantsCollection: [{"$date": "2007-12-03T10:15:30Z"}],
structAggregateEmbeddablesCollection: [{a: 1}]
}],
structAggregateEmbeddablesCollection: []
Expand Down Expand Up @@ -386,6 +403,7 @@ void testArrayAndCollectionValuesOfStructAggregateEmbeddablesHavingArraysAndColl
strings: ["str"],
bigDecimals: [{$numberDecimal: "10.1"}],
objectIds: [{$oid: "000000000000000000000001"}],
instants: [{"$date": "2007-12-03T10:15:30Z"}],
structAggregateEmbeddables: [{a: 1}],
charsCollection: ["s", "t", "r"],
intsCollection: [5],
Expand All @@ -395,6 +413,7 @@ void testArrayAndCollectionValuesOfStructAggregateEmbeddablesHavingArraysAndColl
stringsCollection: ["str"],
bigDecimalsCollection: [{$numberDecimal: "10.1"}],
objectIdsCollection: [{$oid: "000000000000000000000001"}],
instantsCollection: [{"$date": "2007-12-03T10:15:30Z"}],
structAggregateEmbeddablesCollection: [{a: 1}]
}]
}
Expand All @@ -413,7 +432,7 @@ void testArrayAndCollectionValuesOfStructAggregateEmbeddablesHavingArraysAndColl
public void testArrayAndCollectionValuesOfEmptyStructAggregateEmbeddables() {
var emptyStructAggregateEmbeddable = new ArraysAndCollections(
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null);
null, null, null, null, null, null, null, null, null);
var item = new ItemWithArrayAndCollectionValuesOfStructAggregateEmbeddablesHavingArraysAndCollections(
1,
new ArraysAndCollections[] {emptyStructAggregateEmbeddable},
Expand All @@ -438,6 +457,7 @@ public void testArrayAndCollectionValuesOfEmptyStructAggregateEmbeddables() {
strings: null,
bigDecimals: null,
objectIds: null,
instants: null,
structAggregateEmbeddables: null,
charsCollection: null,
intsCollection: null,
Expand All @@ -447,6 +467,7 @@ public void testArrayAndCollectionValuesOfEmptyStructAggregateEmbeddables() {
stringsCollection: null,
bigDecimalsCollection: null,
objectIdsCollection: null,
instantsCollection: null,
structAggregateEmbeddablesCollection: null
}],
structAggregateEmbeddablesCollection: [{
Expand All @@ -464,6 +485,7 @@ public void testArrayAndCollectionValuesOfEmptyStructAggregateEmbeddables() {
strings: null,
bigDecimals: null,
objectIds: null,
instants: null,
structAggregateEmbeddables: null,
charsCollection: null,
intsCollection: null,
Expand All @@ -473,6 +495,7 @@ public void testArrayAndCollectionValuesOfEmptyStructAggregateEmbeddables() {
stringsCollection: null,
bigDecimalsCollection: null,
objectIdsCollection: null,
instantsCollection: null,
structAggregateEmbeddablesCollection: null
}]
}
Expand Down Expand Up @@ -506,6 +529,7 @@ static class ItemWithArrayAndCollectionValues {
String[] strings;
BigDecimal[] bigDecimals;
ObjectId[] objectIds;
Instant[] instants;
StructAggregateEmbeddableIntegrationTests.Single[] structAggregateEmbeddables;
Collection<Character> charsCollection;
Collection<Integer> intsCollection;
Expand All @@ -515,6 +539,7 @@ static class ItemWithArrayAndCollectionValues {
Collection<String> stringsCollection;
Collection<BigDecimal> bigDecimalsCollection;
Collection<ObjectId> objectIdsCollection;
Collection<Instant> instantsCollection;
Collection<StructAggregateEmbeddableIntegrationTests.Single> structAggregateEmbeddablesCollection;

ItemWithArrayAndCollectionValues() {}
Expand All @@ -535,6 +560,7 @@ static class ItemWithArrayAndCollectionValues {
String[] strings,
BigDecimal[] bigDecimals,
ObjectId[] objectIds,
Instant[] instants,
StructAggregateEmbeddableIntegrationTests.Single[] structAggregateEmbeddables,
Collection<Character> charsCollection,
Collection<Integer> intsCollection,
Expand All @@ -544,6 +570,7 @@ static class ItemWithArrayAndCollectionValues {
Collection<String> stringsCollection,
Collection<BigDecimal> bigDecimalsCollection,
Collection<ObjectId> objectIdsCollection,
Collection<Instant> instantsCollection,
Collection<StructAggregateEmbeddableIntegrationTests.Single> structAggregateEmbeddablesCollection) {
this.id = id;
this.bytes = bytes;
Expand All @@ -560,6 +587,7 @@ static class ItemWithArrayAndCollectionValues {
this.strings = strings;
this.bigDecimals = bigDecimals;
this.objectIds = objectIds;
this.instants = instants;
this.structAggregateEmbeddables = structAggregateEmbeddables;
this.charsCollection = charsCollection;
this.intsCollection = intsCollection;
Expand All @@ -569,6 +597,7 @@ static class ItemWithArrayAndCollectionValues {
this.stringsCollection = stringsCollection;
this.bigDecimalsCollection = bigDecimalsCollection;
this.objectIdsCollection = objectIdsCollection;
this.instantsCollection = instantsCollection;
this.structAggregateEmbeddablesCollection = structAggregateEmbeddablesCollection;
}
}
Expand Down
Loading