Software Programmer
asked on
BaseDAO class for JdbcTemplate for native SQL queries - save/update/delete
How to create a BaseDAO class for jdbcTemplate which handles the save, update and delete in generic way so that we can use the same in any entity.
for example, in sales we may have the id column as salesId, in product we have the id column as id, in inventory table we will have the id column as invId.
Assume we need to have one generic method for save which gets something like parameter names and values and inserts it
Example as
https://stackoverflow.com/questions/23830961/jdbctemplate-utilities-for-insert-statement
However the above example doesn't clearly says the or gives the implementation of the BaseObjectMapper and seems pretty big
Need a proper way to define the save, update and delete.
for example, in sales we may have the id column as salesId, in product we have the id column as id, in inventory table we will have the id column as invId.
Assume we need to have one generic method for save which gets something like parameter names and values and inserts it
Example as
https://stackoverflow.com/questions/23830961/jdbctemplate-utilities-for-insert-statement
However the above example doesn't clearly says the or gives the implementation of the BaseObjectMapper and seems pretty big
Need a proper way to define the save, update and delete.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't understand your question.
ASKER
Basic DAO class like http://javadox.com/com.google.code.morphia/morphia/0.99/com/google/code/morphia/dao/BasicDAO.html which has all default methods for query. Looking for a generic Basic DAO since we are using jdbcTemplate in our application
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, you are right. Can you help me with a code snippet?
Take a look at the link I posted.
The best answer should be accepted as answer, since what the asker asks cannot be done.
ASKER