Modified files, Main.java, Customizing eventmanager – HP Integrity NonStop J-Series User Manual

Page 223: Added directories, Dbconfig

Advertising
background image

alter table bid add constraint FK17CFDEE6E7E98 foreign key (item)
references auctionitem;
create table hibernate_unique_key (next_hi integer )
LOCATION <$datavol> ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;
insert into hibernate_unique_key values (1);

Modified Files

Main.java

(<My SASH
Home
>\hibernate\samples\eg\src\main\java\org\hibernate\auction\Main.java)

This class file performs all database operations for Caveat Emptor.

Changes to the Main.java file

Changed the value of Environment.HBM2DDL_AUTO property to false to avoid auto creation
of database tables by Hibernate.

NOTE:

The default value of Environment.HBM2DDL_AUTO is create.

Before the change:

Configuration cfg = new Configuration()
.addClass(AuctionItem.class)
.addClass(Bid.class)
.addClass(User.class)
.setProperty(Environment.HBM2DDL_AUTO, "create");
//cfg.setProperty("hibernate.show_sql", "true");

After the change:

Configuration cfg = new Configuration()
.addClass(AuctionItem.class)
.addClass(Bid.class)
.addClass(User.class)
.setProperty(Environment.HBM2DDL_AUTO, "false");
//cfg.setProperty("hibernate.show_sql", "true");

Customizing EventManager

To customize the EventManager sample application to run on NonStop systems, two directories
and two files were added, and one file was modified.
Added Directories:

/dbconfig

eventmanager_script.sql

Added Files

hibernate.properties

setenv

Modified File

Hibernate.cfg.xml

Added Directories

/dbconfig

(<My SASH Home>\hibernate\samples\web\dbconfig)
This directory contains the database script that is required to set up the EventManager database
on SQL/MX.

/etc

(<My SASH Home>\hibernate\samples\web)

Customizing EventManager 223

Advertising
This manual is related to the following products: