Skip to content

Instantly share code, notes, and snippets.

@ketankhairnar
Created March 15, 2011 10:09
Show Gist options
  • Save ketankhairnar/870540 to your computer and use it in GitHub Desktop.
Save ketankhairnar/870540 to your computer and use it in GitHub Desktop.
ResultSet Processor
public class ResultSeProcessor extends CamelProcessor<MyJPAEntity>
{
public void process(Exchange exchange) throws Exception
{
process(exchange, getRowMapper());
}
private static ResultMapper<MyJPAEntity> getRowMapper()
{
ResultMapper<MyJPAEntity> mapper = new ResultMapper<MyJPAEntity>()
{
public MyJPAEntityvalueOf(HashMap<String, Object> data)
{
MyJPAEntity txn = new MyJPAEntity();
// from resultset set the values to jpa entity and return it
//txn.setXXX((String)data.get("xxx"))
return txn ;
}
};
return mapper;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment