Java Reference
In-Depth Information
After clicking Next> , we need to enter a suitable package name where our session
beans will be created.
In our particular example, our session beans will only need to be accessed from
inside the application server, therefore generating only Local business interfaces
will suffice.
After clicking Finish , session beans are generated with methods to create, update,
delete and find each of the JPA entities in the project.
We have now finished implementing the data access layer of our application,
without having to write a single line of code!
For more complex applications, we may have to add additional logic to
the generated code. For example, we might have to add methods in the
session beans to invoke some of the generated named queries in the JPA
entities. Similarly we might have to add additional named queries to the
entities for retrieving objects meeting additional criteria (for example,
where field1='value1' and/or field2='value2' ). For our
example, the generated code can be used as it is.
 
Search WWH ::




Custom Search