Configuring advanced options
Note: Not all of the options are available in all scenarios. To configure advanced options:
- On the Tasks page of the wizard, select
Other from the Task list.
- Configure the following options:
- Use Resource Injection
Select
Use Resource Injection to generate JPA Manager Beans that use annotations that use the Web container to inject resources and manage the beans. This option allows you to run your application in a managed resource such as a JavaServer Faces Managed Bean.
Clear
Use Resource Injection if you run your application outside of a managed environment, for example, a plain JSP or a Java™ application.
- Use Named Queries
Select
Use Named Queries to add named queries to your JPA Entity in the form of an annotation. The named query annotation contains the query statements that are called by the JPA Manager methods. This keeps the query logic isolated inside of the entity and enables the method to run the queries without having to know the details of the logic.
Clear
Use Named Queries when you want the query logic written directly in the JPA Manager Bean and not to the JPA Entity.
- Update Entity for use in JSF applications
Select
Update Entity for use in JSF applications when working with a JSF application. This option automatically:
- Converts the many side of a relationship from Set to List.
- Converts java.sql.Date to java.util.Date.
- Creates a getSelectListItems() method that can be bound to JSF selectItems for populating a combo box with a list of entities, when using manager beans.
- Update Relationship Fetch Types
Select
Update Relationship Fetch Types to set the fetch type on the relationships in your entity:
- Eager - If set to
Eager, the entity will fill the list of relationships. This is useful if you want to show an entity and its relationship entities on a single page.
- Lazy - If set to
Lazy, the entity will not fill the list of relationships. This is useful if you are interested only in the base entity and not with the entities defined in the relationship.
- Generate JSF Converter for Target Entity
Select
Generate JSF Converter for Target Entity to generate a JSF Converter class for the entity that will enable the JSF framework to convert the Entity to a String or a String to an Entity. The String representation for the entity is the primary key for that entity. You will need a JSF converter if you want to reference the entity in a JSF form input field or combo box.
- Automatically set up initial values for JDBC Deployment
Select
Automatically set up initial values for JDBC Deployment to allow the wizard to try to set up the connection information required for deployment, including your persistence.xml and server information, such as Datasources. If the wizard is unable to determine the information automatically, it will prompt you for the information.
- Configure Project for JDBC Deployment
Select
Configure Project for JDBC Deployment to set up the server specific connection information that will be used at runtime.