We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Follow your advice inside the #148
I don't understand why StringColumnType is Open but not DateColumnType or the other.
StringColumnType
DateColumnType
My goal is to add validity constraint before the insert/update.
Like the Jsr303
For the Date I want to add before: LocalDate, after:LocalDate, defaultValue:LocalDate
LocalDate, after:LocalDate, defaultValue:LocalDate
And I don't want to copy past all the code inside DateColumnType
I think to exentends IColumnType and add a DateColumnType inside MyCustomDateColumnType
IColumnType
The text was updated successfully, but these errors were encountered:
That's a right way! Try to use kotlin delegation (https://kotlinlang.org/docs/reference/delegation.html)
class ValidatedDateTime(val before: LocalDate, val after: LocalDate, val defaultValue: LocalDate, private val timeColType: DateColumnType = DateColumnType(true)) : IColumnType by timeColType { override fun valueToDB(value: Any?): Any? { assert(value != null) // Your validation here return timeColType.valueToDB(value) } }
Sorry, something went wrong.
Ok, it's exactly the code I write. But why StringColumnType is open ? It's just to know you made this choice. Any way thanks for the quick answer.
But why StringColumnType is open ?
StringColumnType has two inheritors in Exposed code, so it was easier to make it open instead of using delegates.
No branches or pull requests
Follow your advice inside the #148
I don't understand why
StringColumnType
is Open but notDateColumnType
or the other.My goal is to add validity constraint before the insert/update.
Like the Jsr303
For the Date I want to add before:
LocalDate, after:LocalDate, defaultValue:LocalDate
And I don't want to copy past all the code inside
DateColumnType
I think to exentends
IColumnType
and add aDateColumnType
inside MyCustomDateColumnTypeThe text was updated successfully, but these errors were encountered: