Clarification needed for using WELD CDI
by Karen Goh
Hi,
I am a beginner in WELD CDI and my purpose of this email is to clarify if WELD CDI can be used in this scenario.
Basically, I started out my web app project using Java, JEE and jsp and DAO design.
The thing is I have problem in getting the id of an entity.
So, my question is how do I use Weld to get the Id and then used it in my DAOimpl ?
I have a insert(Tutor t) method in tutorDAOImpl.
Once the tutor's data is inserted into MYSQL the id is in as well cos it is using Autoincrement.
So, I'm thinking of how to use Weld to get the tutor Id since I have the getter in tutor_id in Tutor class.
In this DAO design, there is also a Manager or Service class which call the tutorDAOImpl's method and it is in turn called by the Controller.
If Weld CDI can be used in my case, please tell me how to go about implementing it.
Thank you & regards,
Karen
5 years, 9 months