This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Query 1 - There are two ways to obtain Persistence Contexts � 1.using the annotations/the persistence XML 2.using the Entity-Manager-Factory API
O�Reilly�s Book explains both, but in the end says 1. is easier than 2 and that since Method 2 is error prone, developers should try to make use of the easy facilities provided be the EJB container. My question is, does the exam expects us to remember each of them in depth?
Query 2 - Also, across chapter 5, the book talks of the Java SE and even the Java EE environment. I did not understand what the Java SE has to do when we are learning something very specific to enterprise apps. But after some thought I came to know that the persistence API to tightly integrated with EJB (a Java EE technology) it can also be very well used by Java SE programs. So, such programs can also use this api to persist things into the database. Am I correct? And since this is possible, there are two ways in which you can configure the persistence.xml tags like <jar-file>, <jta-data-source>, <provider>. One for the Java EE environment and the other for the Java SE environment. Should one worry about the Java SE for the exam ?
Query 3 - Again, there are two ways to obtain Entity-Manager factory � one using the SE way the Entity-Manager-Factory API) and the other using the EE. Should one know both the ways? Also in both the ways there are method where, the book talk of passing a map, which corresponds to the <properties> tag of the persistence.xml file. How are the properties passed to the method? Does the developer write code to pass these? How are the properties mapped to the map? Is the mapping like �
Property name = map key Property value = key�s value I think there are dedicated chapters to explain stuff, but I still had some initial questions.
Please forgive me for posting many questions in a single post. I was really deciphering the new technology called EJB3.0. I think this is a lot of food for thought for the masters like Narendra and others.
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ] Performance is a compulsion, not a option, if my existence is to be justified.
I am not master in technology. I am just studying new technologies like you. I also facing lot of problems like you. Always, we have to learn from mistakes.
Using annotations/Deployment descriptor is easy because it save lot of coding. I do not thing that the factory API are error prone. This is only way to get entity managers in SE environment as these are not managed objects and the annotations are not supported.
The exam topics are about the JPA not the java EE. So you have to learn how you can use the JPA in SE environment also.
You have to know the elements in persistence.xml and orm.xml at introductory level.No deep level knowledge is required. But these topics are interesting to study.
The <properties> element is specific to persistence manager. Yo should know only for what purpose the element is used. The understanding property names and values are not required for the exam.