If you would like your DAO to have a particular method, you can add it by yourself.
First, you must find the DAO implementation generated by ToPIA. It’s an empty class,
for example:
Move it to your source directory and clean it. Don’t forget to leave it in the
same package:
You can now add a method to BookTopiaDao, it will be available without any further steps.
We provides dozens of protected methods to help you.
Add a method on all DAO
If you want to write a method and you want it to be available for all the entities, you can write
it in AbstractMyLibraryTopiaDao. You should find this class in the generated folder and move it
in your project.
Of course, since your method must work for every entities, you should use the generic E as the
entity class.
Run a native SQL query
In a DAO, you have access to a topiaSqlSupport field, you will be able to run
an SQL query by calling any of the method proposed:
Run a HQL queries
In a DAO, you have access to a topiaSqlSupport field, you will be able to run
an SQL query by calling any of the method proposed:
Use HqlAndParametersBuilder to ease generating queries
Add a method on PersistenceContext or ApplicationContext
Both of them can be extended by adding custom methods. We also recommend to find the corresponding
generated file, move it on your project before you start coding.