| In order to run the application, you will need to install MySQL and Glassfish 4.1.1. I use Netbeans to make life easier, but you can run the application following the steps: ------------ 1- Download Netbeans 8.1 from https://netbeans.org/downloads/. It will install Glassfish preconfigured. or 1- Install Glassfish 4.1 (from https://glassfish.java.net/) and maven. Add to your path the bin folder of glassfish and the bin folder of Maven. Set the variable GFHOME as the installation folder for glassfish and add to your PATH=$PATH:$GFHOME/bin ------------ 2- Install MySQL from www.mysql.org and start the service. 3- Setup the test database: mysql -u root -p (type the root password for your database installation) sql> create database test; sql> grant all privileges on test.* to 'test'@'%' identified by 'test'; sql> exit; 4- Unjar the Hibernate-Test.jar file in a folder, cd to that folder and:
- mvn install
- cd Hibernate-GF-Test/Hibernate-GF-Test-ear
- asadmin start-domain
(wait until glassfish is up and running)
- asadmin deploy Hibernate-GF-Test-ear-1.0-SNAPSHOT.ear
- cd $ {GFHOME}
/glassfish/domains/domain1/logs
- tail -500f server.log
Use mysql to show the table structure:
- mysql -u root -p
(type root's password) mysql> use test; desc Book; desc BookNS;
All enums are mapped to a tinyblob type and serialized as such. The field type should be an integer and the ordinal value of the enum should be stored in the database. |