I'm using JavaLite ActiveJDBC to pull data from a local MySQL server. Here is my simple RestController:
@RequestMapping(value = "/blogs")
@ResponseBody
public Blog getAllBlogs( )
throws SQLException {
Base.open( "com.mysql.jdbc.Driver", "jdbc:mysql://localhost:3306/rainydaymatt", "root", "" ) ;
List<Blog> blogs = Blog.where( "postType = 'General'" ) ;
return blogs.get( 0 ) ;
}
And here's my simple model, which extends the ActiveJDBC Model class:
public class Blog
extends Model {
}
Now, here's the problem:when I navigate to the path handled by the controller, I get this output stream:
{"frozen":false,"id":1,"valid":true,"new":false,"compositeKeys":null,"modified":false,"idName":"id","longId":1}
I can tell that this is metadata about the returned objects because the number of these clusters changes based on my parameters - i.e., when I select all, there are four, when I use a parameter, I get the same number as meets the criteria, and only one when I pull the first. What am I doing wrong? Interestingly, when I revert to an old-school DataSource and use the old Connection/PreparedStatement/ResultSet, I'm able to pull data just fine, so the problem can't be in my Tomcat's context.xml or in the path of the Base.open.