Java – what is the default temporaltype for temporal mapping keys without @ mapkeycolumn or @ mapkeytemporary annotations?

I am creating a JPA 2.0 annotation compliance kit for my internship

I know that when you use @ mapkeycolumn to define the column of map key, you can export the type of key that should be mapped to by viewing the type of column (and the type in columndefinition) Therefore, in this case, the @ mapkeytemporary annotation is not required

When attaching @ mapkeytemporary annotation, the column name defaults to attribute "_key"

If @ mapkeycolumn and @ mapkeytemporary are not annotated, the column name defaults to attribute "_key", but what is the default value of the key? Or should you get a mistake?

I looked for a similar situation and found @ mapkeyenumerated It is the same because it is related to @ mapkeycolumn. It is a value that can be mapped to multiple data types (@ mapkeytemporary's java.sql.date/java.sql.time/java.sql.timestamp and enumeratiedtype.ordinal/enumeratiedtype.string for @ mapkeyenumerated) I found a difference: @ mapkeyenumerated has a default value The default value is enumeratiedtype ORDINAL.

My question: when using a mapping with a mapping key whose base type is temporary, what is the default temporaltype (according to JPA 2.0) that converts the mapping key to persistence?

Solution

The answer seems to be, when Java util. Date or Java util. Calendar has no default type when used as a map keyword The specification itself (I do think JavaDocs is provided with the specification as part of the specification) is very strict about the use of mapkeytemporary Mapkeytemporary's Javadoc claims:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>