-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change outdated and/or deprecated data binding defaults for String, Instant and Duration #20
Comments
@lavrukov @akorsukov Proposed plan of action:
|
@lavrukov @akorsukov What's the position of Cloud Java on this? Will you be able to explicitly set legacy mapping defaults for your services in a YC-specific module, so that YOJ can use more sensible type mapping for Strings, Instants and Durations? If that's OK, I'll first add explicit "set legacy mapping" methods that you can use. |
Added opt-in support for New Mapping in YOJ 2.1.0.
YqlPrimitiveType.useLegacyMappingFor(STRING, ENUM, TIMESTAMP); in legacy projects to keep the old mapping, and YqlPrimitiveType.useRecommendedMappingFor(STRING, ENUM, TIMESTAMP); in new projects to get the new mapping. Note that |
What should you do?
YqlPrimitiveType.useLegacyMappingFor(STRING, ENUM, TIMESTAMP); before initializing YOJ, e.g., in a lifecycle method.
YqlPrimitiveType.useLegacyMappingFor(STRING, ENUM, TIMESTAMP); before initializing YOJ, e.g., in a lifecycle method. 👍 Using the NEW MAPPING is HIGHLY RECOMMENDED for new projects, when you have no existing table schema and/or data to migrate. If you decide to use the new mapping in an OLD project, remember to annotate existing entities' columns with the column type used in the database:
|
See also: #71 for more mapping improvements. |
Change outdated and/or deprecated data binding defaults, while supporting older defaults for backwards compatibility. 1-2 months after initial commit
String
<->UTF8
(because a YDBSTRING
is actually a byte array)Instant
<->TIMESTAMP
,Duration
<->INTERVAL
.Instant
<->[U]INT64
should useMILLISECONDS
qualifier by default, for maximum backwards compatibility (YOJ initially supported only milliseconds precision when storingInstant
s)The text was updated successfully, but these errors were encountered: