[
https://issues.apache.org/jira/browse/IGNITE-22181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17850614#comment-17850614
]
Iurii Gerzhedovich commented on IGNITE-22181:
---------------------------------------------
[~aleksandr.pakhomov] which scale is expected for column `b` during creating
the table? I don't see any specified values related to scale and precision on
the POJO
> BigDecimal scale is lost during create table
> --------------------------------------------
>
> Key: IGNITE-22181
> URL: https://issues.apache.org/jira/browse/IGNITE-22181
> Project: Ignite
> Issue Type: Bug
> Reporter: Aleksandr
> Priority: Major
> Labels: ignite-3
>
> Given a pojo
> {code:java}
> @Table
> public static class PojoClass {
> @Id
> private Integer i;
> private BigDecimal b;
> public Integer getI() {
> return i;
> }
> public void setI(int i) {
> this.i = i;
> }
> public BigDecimal getB() {
> return b;
> }
> public void setB(BigDecimal b) {
> this.b = b;
> }
> {code}
> I create a table from it with this call:
> {code:java}
> client.catalog().create(PojoClass.class).execute();
> {code}
> Then I insert one record and read it:
> {code:java}
> var table = client.tables().table(PojoClass.class.getSimpleName());
> var pojo = new PojoClass();
> pojo.setI(44);
> pojo.setB(new BigDecimal("123.45")); // <-- NOTE
> var pojoRecordView = table.recordView(PojoClass.class);
> pojoRecordView.insert(null, pojo);
> var keyPojo = new PojoClass();
> keyPojo.setI(44);
> assertThat(pojoRecordView.get(null, keyPojo), equalTo(pojo)); <-- THIS FAILS
> {code}
> The assertion is failed due the scale (2) is lost for the BigDecimal field
> during the table creation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)