-
Notifications
You must be signed in to change notification settings - Fork 697
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
DAO and DB defaults don't support in batch inserts #1599
Comments
Or, if it is technically impossible, maybe there's a way to avoid |
Could you elaborate a bit more on that, please? Thanks! |
@AlexeySoshin thank you for getting back to me!
And corresponding entity of this type:
The database defines
When we're trying to insert a new Entity as:
We're getting the following error:
While we can apply |
Thank you. Seems that what you'd like is to have something like So you would define object TestTable : LongIdTable(name = "test_table") {
val seed = long("seed").transient()
} And that field will be omitted from inserts / updates |
@AlexeySoshin, I'm afraid the idea behind JPA's Two vital points are coming to my mind for our case:
So, long story short, we would have the Exposed to be able to define: |
@smelfungus Just curious, how is this default being defined? Are you using any Exposed API for it or doing it through raw SQL with |
@joc-a, sure, we're using the database-first approach, so our database structure is defined by some external schema and migrations managed by Flyway. Respectively, this column is defined as:
The thing we were trying to achieve here is to make the Exposed respect database defaults and not make us redefine anything in the code with something like |
Hello!
What would be the correct strategy for DAO to rely on DB defaults and not force clients to define them?
seed
is always generated on the DB side, and we want clients to know nothing about the logic behind the seed generation nor set some fallbacks/defaults. The insert attempt results in:The text was updated successfully, but these errors were encountered: