I am new to CouchDB and Ektorp (I ACTUALLY started today to try to work with it). The most detailed documentation I have found to help me getting started is this one:
http://www.ektorp.org/reference_documentation.html#d100e394
My use case is that I want to save a very complex class as a document (I have managed that so far), but I do not want to load all the fields all the time (since some of those are potentially big collections of other simpler documents).
Here is an example of what I have (its just an experimental class I am using to learn to use Ektorp and CouchDB
@JsonSerialize(include = Inclusion.NON_NULL)
public class Player extends CouchDbDocument {
private int xp = 0;
@JsonDeserialize(using = CoinPouchDeserializer.class)
private CoinPouch coins = new CoinPouch(); // subclass of enumMap not
// complex
@DocumentReferences(backReference = "playerId", fetch = FetchType.LAZY, descendingSortOrder = true, orderBy = "itemid")
private Inventory inventory = new Inventory();// subclass of Map<String,
// Item> Items are document
// themselves
}
I manage to save it and get it by id just fine. But how to I get it without loading it inventory?
I would also appreciate any link to other resources I should checkout about starting to use couchdb or ektorp with java (or scala), cheers.
Thanks for any helpful answer.