Closed gavinking closed 12 months ago
String
for AUTO
? I don't know if that's a good idea. Other than that, looks reasonable.
I think the idea is UUID-as-String. It's AUTO, so "the persistence provider should pick an appropriate strategy"
I expect that on the right side are java types. So ie. for current Postgres it is UUID:UUID, but for some older database it can be VARCHAR:UUID.
EDIT: Mea culpa, I should read slowly.
String
forAUTO
? I don't know if that's a good idea. Other than that, looks reasonable.
Ah, right, I thought we already said that, but actually we don't. So I would change:
In the case of a field or property of type
java.util.UUID
, theAUTO
strategy is equivalent toUUID
.
To:
In the case of a field or property of type
java.util.UUID
orjava.lang.String
, theAUTO
strategy is equivalent toUUID
.
Can UUID
be applied to byte[]
so long as it is 16-bytes.
For byte[]
and AUTO
same semantics but can be arbitrary sized array
For completeness:
For byte[]
and IDENTITY
same semantics but can be arbitrary sized array but it is a binary sequence of Little-Endian (or Big-Endian, whichever you guys think is appropriate)
Section 2.4 does not list byte[]
as a valid primary key type.
So that would be an orthogonal change.
Section 2.4 does not list
byte[]
as a valid primary key type.
Actually thinking about it, it would be insane for anyone normal to work on the UUID or AUTO as byte[]
. I don't think it's worth it.
For one if this was done, the vendor needs to convert byte[]
to a ByteBuffer
so comparisons can be made. In addition, it would need ByteBuffer
as another option.
But as I stated, no sane architecture I think would use this. Short of those that need that extra bit of performance and space savings since ByteBuffer or byte[] as I noted earlier do not need to be 16-bytes and can be say 2-bytes for a 64k record max reference table lookup.
I might be missing something, but the spec appears to be silent on the issue of which id types correpond to which
GenerationType
s. I think it should explicitly specify something like this:IDENTITY
,SEQUENCE
,TABLE
->Long
,Integer
,long
,int
UUID
->String
,UUID
AUTO
->Long
,Integer
,long
,int
,String
,UUID
Thoughts?