<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body>
Hi Matej,<div><br></div><div>Thank you for your reply but I managed to resolved the issue of getting the id. It is something fundamental and yet I had no idea where I had gone wrong till I read a Dzone article about null pointer exception.</div><div><br></div><div>I thought using Dependency injection will solve my problem, after trying things out for so long.</div><div><br></div><div>However, I would still be interested to find out how WELD CDI is different from EJB’s ( I beg your pardon if there isn’t cos I hadn’t the chance touch on EJB since I left my studies). </div><div><br></div><div>I read from Adam Biden’s using Weld CDI with Tomcat so I do not know if cost savings is the reason. </div><div><br></div><div>Hope to hear from you again.</div><div><br></div><div>Many thanks.</div><div><br></div><div>Karen</div><div><br></div><div><br><br><br><a href="https://overview.mail.yahoo.com/?.src=iOS">Sent from Yahoo Mail for iPhone</a><br><br><p class="yahoo-quoted-begin" style="font-size: 15px; color: #715FFA; padding-top: 15px; margin-top: 0">On Wednesday, January 2, 2019, 4:35 PM, Matej Novotny <manovotn@redhat.com> wrote:</p><blockquote class="iosymail"><div dir="ltr">Hello Karen,<br clear="none"><br clear="none">Is your code public on GitHub (or somewhere else)?<br clear="none">It would be easier to try and help you if I could see the code.<br clear="none">From just the description I don't really understand how do you leverage CDI in your design and which bits work and which don't.<br clear="none"><br clear="none">Regards<br clear="none">Matej<br clear="none"><div class="yqt2375950819" id="yqtfd46665"><br clear="none">----- Original Message -----<br clear="none">> From: "Karen Goh" <<a shape="rect" ymailto="mailto:karenworld@yahoo.com" href="mailto:karenworld@yahoo.com">karenworld@yahoo.com</a>><br clear="none">> To: <a shape="rect" ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br clear="none">> Sent: Monday, December 24, 2018 11:26:38 AM<br clear="none">> Subject: [weld-dev] Clarification needed for using WELD CDI<br clear="none">> <br clear="none">> Hi,<br clear="none">> <br clear="none">> I am a beginner in WELD CDI and my purpose of this email is to clarify if<br clear="none">> WELD CDI can be used in this scenario.<br clear="none">> <br clear="none">> Basically, I started out my web app project using Java, JEE and jsp and DAO<br clear="none">> design.<br clear="none">> <br clear="none">> The thing is I have problem in getting the id of an entity.<br clear="none">> <br clear="none">> So, my question is how do I use Weld to get the Id and then used it in my<br clear="none">> DAOimpl ?<br clear="none">> <br clear="none">> I have a insert(Tutor t) method in tutorDAOImpl.<br clear="none">> <br clear="none">> Once the tutor's data is inserted into MYSQL the id is in as well cos it is<br clear="none">> using Autoincrement.<br clear="none">> <br clear="none">> So, I'm thinking of how to use Weld to get the tutor Id since I have the<br clear="none">> getter in tutor_id in Tutor class.<br clear="none">> <br clear="none">> In this DAO design, there is also a Manager or Service class which call the<br clear="none">> tutorDAOImpl's method and it is in turn called by the Controller.<br clear="none">> <br clear="none">> If Weld CDI can be used in my case, please tell me how to go about<br clear="none">> implementing it.<br clear="none">> <br clear="none">> Thank you & regards,<br clear="none">> Karen</div><br clear="none">> <br clear="none">> <br clear="none">> _______________________________________________<br clear="none">> weld-dev mailing list<br clear="none">> <a shape="rect" ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br clear="none">> <a shape="rect" href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><div class="yqt2375950819" id="yqtfd12112"><br clear="none">> <br clear="none"></div></div><blockquote></blockquote></blockquote></div>
</body></html>