camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico <nicoso...@gmail.com>
Subject Marshaling to json from jdbc
Date Sat, 03 Nov 2012 23:22:54 GMT
Hello I've a route like the following:

from("direct:a")
		.setBody(constant("SELECT * FROM \"schema1\".\"table1\""))
		.to("jdbc:pgDS")
		.split(body())
			.marshal().json(JsonLibrary.XStream, Table1Record.class)
			.to("direct:b")
		.end();


And the following class:

@XStreamAlias("Table1Record")
public class Table1Record {
	@XStreamAlias("Field1")
	public Long field1;

	public Long getField1() {
		return field1;
	}
	public void setField1(Long field1) {
		this.field1 = field1;
	}
}

But eveen marshalling it to Table1Record, annotated with xstream, this
expression: exchange.getIn().getBody(String.class) returns me something like
this: {"linked-hash-map":{"entry":[{"string":"Field1","int":5}]}}

And exchange.getIn().getBody(Table1Record.class) returns me null...

Any clue on this?

If more information is needed please ask me.

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/Marshaling-to-json-from-jdbc-tp5722094.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message