Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make backends more exchangable #468
I am currently introducing querydsl-sql into my project as a replacement for Mybatis. We need to do a lot of ad-hoc queries, so it suits our needs much better.
I have implemented a simple repository layer on top of querydsl so that my team members just need to inherit from a base class and get all the usual CRUD operations for free.
One thing I would like to add is in-memory repositories for testing. Currently we use Easymock to mock a repository for unit tests. But that gets tedious very quickly.
The problem is that querydsl-sql uses the column name as the path name, so querydsl-collections looks for the wrong fields. E.g. it looks for "first_name" when it should be looking for "firstName".
One way to solve this would be to add a layer on top of "Path", named "Column", e.g.:
The SQL serializer and the generator would need to be changed for this. Do you see an easier way of doing this?