Book Image

Advanced Java EE Development with WildFly

By : Deepak Vohra
Book Image

Advanced Java EE Development with WildFly

By: Deepak Vohra

Overview of this book

<p>This book starts with an introduction to EJB 3 and how to set up the environment, including the configuration of a MySQL database for use with WildFly. We will then develop object-relational mapping with Hibernate 4, build and package the application with Maven, and then deploy it in&nbsp;WildFly 8.1, followed by a demonstration of the use of Facelets in a web application.</p> <p>Moving on from that, we will create an Ajax application in the Eclipse IDE, compile and package it using Maven, and run the web application on WildFly 8.1 with a MySQL database. In the final leg of this book, we will discuss support for generating and parsing JSON with WildFly 8.1.</p>
Table of Contents (18 chapters)
Advanced Java EE Development with WildFly
Credits
About the Author
About the Reviewers
www.PacktPub.com
Disclaimer
Preface
Index

Creating a Hibernate configuration file


The Hibernate configuration can be specified in the Hibernate Configuration File (cfg.xml), which has more configuration parameters than the properties file.

Note

Either the properties file or the configuration file can be used to specify the configuration, or both can be used. If both are provided, the configuration file overrides the properties file for the configuration parameters specified in both.

The Hibernate XML configuration file has the following advantages over the properties file:

  • The Hibernate configuration file is more convenient when tuning the Hibernate cache. The Hibernate configuration file has the provision to configure the Hibernate XML Mapping files.

  • For exporting a schema to a database using the SchemaExport tool, just the properties file would suffice, but for object/relational mapping of a persistence class, the Hibernate XML configuration file is a better option.

The following are the steps to create a Hibernate configuration file...