-
Notifications
You must be signed in to change notification settings - Fork 695
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
docs: EXPOSED-578 Extend the Entity definition topic and add examples #2302
Conversation
…overrides and immutable entities
documentation-website/Writerside/topics/DAO-Entity-definition.topic
Outdated
Show resolved
Hide resolved
documentation-website/Writerside/topics/DAO-Entity-definition.topic
Outdated
Show resolved
Hide resolved
...n-website/Writerside/snippets/exposed-dao/src/main/kotlin/org/example/entities/CityEntity.kt
Outdated
Show resolved
Hide resolved
...iterside/snippets/exposed-dao/src/main/kotlin/org/example/entities/UserEntityWithOverride.kt
Outdated
Show resolved
Hide resolved
class EntityWithUInt : IntEntity() { | ||
var uint: UInt by TableWithUnsignedInteger.uint.transform({ it.toInt() }, { it.toUInt() }) | ||
|
||
companion object : IntEntityClass<EntityWithUInt>() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is missing a few pieces to compile:
class EntityWithUInt(id: EntityID<Int>) : IntEntity(id) {
var uint: UInt by TableWithUnsignedInteger.uint.transform({ it.toInt() }, { it.toUInt() })
companion object : IntEntityClass<EntityWithUInt>(TableWithUnsignedInteger)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed and moved to a separate entity file. This function seems to be deprecated though. Is there a better example we can show here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the old DAO transform()
is currently deprecated but it will not be removed from the API entirely until some issues with caching are fully resolved.
If all goes well, this entire 'Fields transformation' section would become redundant and we could redirect users to the DSL transform section.
But if the issues prove problematic, then it would be good to keep this example up in the event we rollback deprecation (or implement some other DAO-level change).
0ba6734
to
52ae2b8
Compare
Description
Extended the Entity definition topic in the following ways:
exposed-dao
project for method overrides and immutable entities.Type of Change
Please mark the relevant options with an "X":
Related Issues
EXPOSED-578