Do I need to create POJO in advance that mapped to Document in couchDB in order to fetch data?

29 views
Skip to first unread message

dae.y...@gmail.com

unread,
Jun 1, 2019, 3:06:23 AM6/1/19
to ektorp-discuss
I have a database named "Foo" registered in couchDB. The db has 10 data type of "Person" object that has name and age. I want to fetch one or all of this type of data using this API via Java web application (Jersey rest service). After reading documentation from https://github.com/helun/Ektorp I began to wonder if I need to create POJO in advance that maps to document registered in the database but I am not too sure. I was hoping that once I have CouchDbConnector I would be able to fetch existing data (document) from the database somehow but it seems like I have to create Person POJO in client application. Is that right?

dade...@googlemail.com

unread,
Jun 14, 2019, 12:41:54 AM6/14/19
to ektorp-discuss
Not necessarily. There is also an example of how to read the raw stream. You could parse that yourself, using something like Jackson for example. Thing is: Why don't you want to create that POJO? That's the whole point of ektorp: To spare you from having to map your objects manually. If you want to access only raw data anyway, why not use something that speaks REST directly with CouchDB? For example Postman would fulfill your manual needs.Or something like RestTemplate in Spring.
Reply all
Reply to author
Forward
0 new messages