Skip to content
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

Some database Null value are converted to 0 #2

Closed
e-marchand opened this issue Mar 11, 2024 · 1 comment
Closed

Some database Null value are converted to 0 #2

e-marchand opened this issue Mar 11, 2024 · 1 comment
Assignees

Comments

@e-marchand
Copy link
Contributor

an integer field declared optional receive 0 value instead of null

    @JsonProperty("numScelleBouteille") val numScelleBouteille: Int? = null,

Generated code show that null is accepted

CREATE TABLE IF NOT EXISTS `Lots` (`photo1` TEXT, `photo2` TEXT, `photo3` TEXT, `dateOperationDTMC` TEXT, `installations` TEXT, `analyse` INTEGER, `volume` REAL, `dateOperation` TEXT, `heurePrelevement` TEXT, `modalitePrelevement` INTEGER, `numScelleBouteille` INTEGER, `signataire` TEXT, `signature` TEXT, `volumeDTMC` REAL, `numLot` TEXT, `lot_S_K` TEXT, `lot_QS` INTEGER, `operateur` TEXT, `produit` TEXT, `millesime` TEXT, `typeOperation` TEXT, `installationOperation` TEXT, `installationStockage` INTEGER, `origineLot` TEXT, `analyseTransmise` INTEGER, `commentaire` TEXT, `__KEY` TEXT NOT NULL, `__STAMP` INTEGER, `__GlobalStamp` INTEGER, `__TIMESTAMP` TEXT, PRIMARY KEY(`__KEY`))");
 _columnsLots.put("numScelleBouteille", new TableInfo.Column("numScelleBouteille", "INTEGER", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
@e-marchand e-marchand self-assigned this Mar 11, 2024
@e-marchand
Copy link
Contributor Author

finally not really NULL but "null" are inserted by project generator
this project has no issue

"null" string injected into integer field, are casted. to 0 when converting to int

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant