NetBeans Java EE Tip #1 – Entity Classes From Database
The NetBeans IDE is an excellent choice for developing applications of all kind. Specifically, I use it on a daily basis for developing and maintaining Java EE applications. Not only has Java EE become much more productive over the past few releases, but the NetBeans IDE has also reduced the time that it takes to develop an application…making Java EE and NetBeans an excellent match!
One of the features that I use the most is the ability to generate entity classes from the database. NetBeans makes it easy to add an entity class to your project without any coding.
First, right-click on a project package, and choose “New->Entity Classes from Database” (Figure 1).
Next, select a data source, and then choose at least one table from the “Available Tables” list, as shown in Figure 2.
Choose the Project, location, and package to which the entity class will be added. Then specify any preferences to indicate if you’d like named queries, JAXB annotations, or MappedSuperClass instead of entities. (Figure 3)
Lastly, select mapping options for your entity class, as shown in Figure 4.
Viola…you have an entity class that is ready to use…compliments of NetBeans IDE!
Reference: | NetBeans Java EE Tip #1 – Entity Classes From Database from our JCG partner Josh Juneau at the Josh’s Dev Blog – Java, Java EE, Jython, Oracle, and More… blog. |