couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Bordoley <bordo...@gmail.com>
Subject Question when using JCouchDB java binding
Date Sat, 14 Feb 2009 18:07:29 GMT
I'm having an issue using the JCouchDB binding (I hope this is an
appropriate list to ask this question???). In CouchDB I'm storing a
simple nested object like the following:

{
  "var1": {

  }
}

In my Java Code I'd like to map the object contained in var1 to a
specific POJO class in my outer POJO. For instance:

public class innerClass {
  .
  Getters/Setters
  .
}

public class myClass {

  public setVar1(InnerClass obj) {
     ...
  }
}

Unfortunately no matter what I try I can't seem to get this to work. I
keep receiving the following exception the Svenson JSON library, and
from a cursory look at the code, I'm wondering if this is even
supported.

org.svenson.JSONParseException: Cannot set property media on class
contentstore.dao.MediaEntry
	at org.svenson.JSONParser.parseObjectInto(JSONParser.java:357)
	at org.svenson.JSONParser.parseObjectInto(JSONParser.java:389)
	at org.svenson.JSONParser.parseArrayInto(JSONParser.java:283)
	at org.svenson.JSONParser.parseObjectInto(JSONParser.java:399)
	at org.svenson.JSONParser.parse(JSONParser.java:185)
	at org.jcouchdb.db.Response.getContentAsBean(Response.java:129)
	at org.jcouchdb.db.Database.queryViewInternal(Database.java:505)
	at org.jcouchdb.db.Database.queryView(Database.java:365)

Any suggestions, I've tried annotated type hints, using a JSONParser,
all to no avail. Am I missing something?

Thanks for any help you can provide.

Dave

Mime
View raw message