@@ -61,7 +61,7 @@ protected String getPgJsonbInternal(int columnIndex) {
61
61
throw new UnsupportedOperationException ("Not implemented" );
62
62
}
63
63
64
- protected abstract long getPgOidInternal (int columnIndex ) {
64
+ protected long getPgOidInternal (int columnIndex ) {
65
65
throw new UnsupportedOperationException ("Not implemented" );
66
66
}
67
67
@@ -126,11 +126,11 @@ protected List<String> getPgJsonbListInternal(int columnIndex) {
126
126
throw new UnsupportedOperationException ("Not implemented" );
127
127
}
128
128
129
- protected abstract long [] getPgOidArrayInternal (int columnIndex ) {
129
+ protected long [] getPgOidArrayInternal (int columnIndex ) {
130
130
throw new UnsupportedOperationException ("Not implemented" );
131
131
}
132
132
133
- protected abstract List <Long > getPgOidListInternal (int columnIndex ) {
133
+ protected List <Long > getPgOidListInternal (int columnIndex ) {
134
134
throw new UnsupportedOperationException ("Not implemented" );
135
135
}
136
136
@@ -177,15 +177,20 @@ public boolean getBoolean(String columnName) {
177
177
178
178
@ Override
179
179
public long getLong (int columnIndex ) {
180
- checkNonNullOfCodes (columnIndex , Arrays .asList (Code .ENUM , Code .INT64 ), columnIndex );
181
- return getLongInternal (columnIndex );
180
+ checkNonNullOfCodes (
181
+ columnIndex , Arrays .asList (Code .ENUM , Code .PG_OID , Code .INT64 ), columnIndex );
182
+ return getColumnType (columnIndex ).getCode () == Code .PG_OID
183
+ ? getPgOidInternal (columnIndex )
184
+ : getLongInternal (columnIndex );
182
185
}
183
186
184
187
@ Override
185
188
public long getLong (String columnName ) {
186
189
int columnIndex = getColumnIndex (columnName );
187
- checkNonNullOfCodes (columnIndex , Arrays .asList (Code .ENUM , Code .INT64 ), columnName );
188
- return getLongInternal (columnIndex );
190
+ checkNonNullOfCodes (columnIndex , Arrays .asList (Code .ENUM , Code .PG_OID , Code .INT64 ), columnName );
191
+ return getColumnType (columnIndex ).getCode () == Code .PG_OID
192
+ ? getPgOidInternal (columnIndex )
193
+ : getLongInternal (columnIndex );
189
194
}
190
195
191
196
@ Override
@@ -271,19 +276,6 @@ public String getPgJsonb(String columnName) {
271
276
return getPgJsonbInternal (columnIndex );
272
277
}
273
278
274
- @ Override
275
- public long getPgOid (int columnIndex ) {
276
- checkNonNullOfType (columnIndex , Type .pgOid (), columnIndex );
277
- return getPgOidInternal (columnIndex );
278
- }
279
-
280
- @ Override
281
- public long getPgOid (String columnName ) {
282
- int columnIndex = getColumnIndex (columnName );
283
- checkNonNullOfType (columnIndex , Type .pgOid (), columnName );
284
- return getPgOidInternal (columnIndex );
285
- }
286
-
287
279
@ Override
288
280
public ByteArray getBytes (int columnIndex ) {
289
281
checkNonNullOfCodes (columnIndex , Arrays .asList (Code .PROTO , Code .BYTES ), columnIndex );
@@ -391,31 +383,43 @@ public List<Boolean> getBooleanList(String columnName) {
391
383
@ Override
392
384
public long [] getLongArray (int columnIndex ) {
393
385
checkNonNullOfCodes (columnIndex , Collections .singletonList (Code .ARRAY ), columnIndex );
394
- checkArrayElementType (columnIndex , Arrays .asList (Code .ENUM , Code .INT64 ), columnIndex );
395
- return getLongArrayInternal (columnIndex );
386
+ checkArrayElementType (
387
+ columnIndex , Arrays .asList (Code .ENUM , Code .PG_OID , Code .INT64 ), columnIndex );
388
+ return getColumnType (columnIndex ).getArrayElementType ().getCode () == Code .PG_OID
389
+ ? getPgOidArrayInternal (columnIndex )
390
+ : getLongArrayInternal (columnIndex );
396
391
}
397
392
398
393
@ Override
399
394
public long [] getLongArray (String columnName ) {
400
395
int columnIndex = getColumnIndex (columnName );
401
396
checkNonNullOfCodes (columnIndex , Collections .singletonList (Code .ARRAY ), columnName );
402
- checkArrayElementType (columnIndex , Arrays .asList (Code .ENUM , Code .INT64 ), columnName );
403
- return getLongArrayInternal (columnIndex );
397
+ checkArrayElementType (
398
+ columnIndex , Arrays .asList (Code .ENUM , Code .PG_OID , Code .INT64 ), columnName );
399
+ return getColumnType (columnIndex ).getArrayElementType ().getCode () == Code .PG_OID
400
+ ? getPgOidArrayInternal (columnIndex )
401
+ : getLongArrayInternal (columnIndex );
404
402
}
405
403
406
404
@ Override
407
405
public List <Long > getLongList (int columnIndex ) {
408
406
checkNonNullOfCodes (columnIndex , Collections .singletonList (Code .ARRAY ), columnIndex );
409
- checkArrayElementType (columnIndex , Arrays .asList (Code .ENUM , Code .INT64 ), columnIndex );
410
- return getLongListInternal (columnIndex );
407
+ checkArrayElementType (
408
+ columnIndex , Arrays .asList (Code .ENUM , Code .PG_OID , Code .INT64 ), columnIndex );
409
+ return getColumnType (columnIndex ).getArrayElementType ().getCode () == Code .PG_OID
410
+ ? getPgOidListInternal (columnIndex )
411
+ : getLongListInternal (columnIndex );
411
412
}
412
413
413
414
@ Override
414
415
public List <Long > getLongList (String columnName ) {
415
416
int columnIndex = getColumnIndex (columnName );
416
417
checkNonNullOfCodes (columnIndex , Collections .singletonList (Code .ARRAY ), columnName );
417
- checkArrayElementType (columnIndex , Arrays .asList (Code .ENUM , Code .INT64 ), columnName );
418
- return getLongListInternal (columnIndex );
418
+ checkArrayElementType (
419
+ columnIndex , Arrays .asList (Code .ENUM , Code .PG_OID , Code .INT64 ), columnName );
420
+ return getColumnType (columnIndex ).getArrayElementType ().getCode () == Code .PG_OID
421
+ ? getPgOidListInternal (columnIndex )
422
+ : getLongListInternal (columnIndex );
419
423
}
420
424
421
425
@ Override
@@ -530,32 +534,6 @@ public List<String> getPgJsonbList(String columnName) {
530
534
return getPgJsonbListInternal (columnIndex );
531
535
}
532
536
533
- @ Override
534
- public long [] getPgOidArray (int columnIndex ) {
535
- checkNonNullOfType (columnIndex , Type .array (Type .pgOid ()), columnIndex );
536
- return getPgOidArrayInternal (columnIndex );
537
- }
538
-
539
- @ Override
540
- public long [] getPgOidArray (String columnName ) {
541
- int columnIndex = getColumnIndex (columnName );
542
- checkNonNullOfType (columnIndex , Type .array (Type .pgOid ()), columnName );
543
- return getPgOidArrayInternal (columnIndex );
544
- }
545
-
546
- @ Override
547
- public List <Long > getPgOidList (int columnIndex ) {
548
- checkNonNullOfType (columnIndex , Type .array (Type .pgOid ()), columnIndex );
549
- return getPgOidListInternal (columnIndex );
550
- }
551
-
552
- @ Override
553
- public List <Long > getPgOidList (String columnName ) {
554
- int columnIndex = getColumnIndex (columnName );
555
- checkNonNullOfType (columnIndex , Type .array (Type .pgOid ()), columnName );
556
- return getPgOidListInternal (columnIndex );
557
- }
558
-
559
537
@ Override
560
538
public List <ByteArray > getBytesList (int columnIndex ) {
561
539
checkNonNullOfCodes (columnIndex , Collections .singletonList (Code .ARRAY ), columnIndex );
0 commit comments