influxdata / influxdata/influxdb-java

InfluxDBResultMapper doesnt call POJO setter

Open
#670 6 comments 0 reactions 1 assignee View on GitHub

@fmachado is already working on this.

Since Apr 7, 2020.

kind/enhancement question
Dominant language
Java
Stars
1.2k
Forks
469
PR merge metrics
No merged PRs in 30d

Description

It is puzzling that InfluxDBResultMapper doesnt call POJO setter.
My POJO looks like

class MyPOJO
{
    @Column(name = "time")
    private Instant time;

    //getter ignored
    public void setTime(Instant time) {  
        this.time = time.truncatedTo(ChronoUnit.SECONDS);
    }
}

Then I do something like

    final List<MyPOJO> resultEvents =  resultMapper.toPOJO(result, MyPOJO.class);

Assumption is setTime would be called for each point fetched. But it doesnt. It somehow bypasses it. time is private. Reflection in play here?
Expectation is that if I remove my setter, toPOJO call would fail. But it doesnt.

I have tried 2.17, 2.7 and 2.9 versions.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.