Added files, Hibernate.properties, Eventmanager_script.sql – HP Integrity NonStop J-Series User Manual

Page 224

Advertising
background image

This directory is included in the SAMPLES.zip file and contains the hibernate3sqlmx.jar
file.

Added Files

hibernate.properties

(<My SASH Home>\hibernate\samples\web\src\main\resources\
hibernate.properties

)

This file provides hibernate configuration to EventManager.

The content of the hibernate.properties file is:

##------------------------------------------------------------------------------
# SQL/MX Settings for JDBC Type 2 Driver
#hibernate.dialect org.hibernate.dialect.SqlmxDialect
#hibernate.connection.driver_class com.tandem.sqlmx.SQLMXDriver
#hibernate.connection.url jdbc:sqlmx://
#hibernate.connection.username
#hibernate.connection.password
#hibernate.connection.catalog eventcat
#hibernate.connection.schema eventsch

#-------------------------------------------------------------------------------
# SQL/MX Settings for JDBC Type 4 Driver
#hibernate.dialect org.hibernate.dialect.SqlmxDialect
#hibernate.connection.driver_class com.tandem.t4jdbc.SQLMXDriver
#hibernate.connection.url jdbc:t4sqlmx://<HP NonStop System IP Address>:<Port No.>
#hibernate.connection.username <HP NonStop Username>
#hibernate.connection.password <HP NonStop Password>
#hibernate.connection.catalog eventcat
#hibernate.connection.schema eventsch

hibernate.show_sql true
hibernate.hbm2ddl.auto false

hibernate.cache.provider_class org.hibernate.cache.NoCacheProvider
hibernate.current_session_context_class org.hibernate.context.ManagedSessionContext

#For JDBC Type 4 Driver:
#
#<HP NonStop System IP Address> - This is the IP address of your NonStop system
#<Port No.> - This is the Port Number of JDBC Data Source
#<HP NonStop Username> - This is the HP NonStop system UserName
#<HP NonStop Password> - This is the HP NonStop system Password

eventmanager_script.sql

(<My SASH Home>\hibernate\samples\web\dbconfig\eventmanager_script.sql)
This script file creates database catalog, schema, and database tables for EventManager.
The content of this file is:

log caveat.log;

drop schema eventcat.eventsch cascade;
drop catalog eventcat;

create catalog eventcat LOCATION <node.$vol>;
create schema eventcat.eventsch AUTHORIZATION "<user>" LOCATION ZSD<subvol reference>;
set schema eventcat.eventsch;

create table EVENTS (EVENT_ID bigint not null, EVENT_DATE timestamp, title varchar(255),
primary key (EVENT_ID))LOCATION <$datavol> ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;

create table PERSON (PERSON_ID bigint not null, age integer, firstname varchar(255),
lastname varchar(255), primary key (PERSON_ID)) LOCATION <$datavol> ATTRIBUTE EXTENT (16, 64),
MAXEXTENTS 160;

create table PERSON_EMAIL_ADDR (PERSON_ID bigint not null, EMAIL_ADDR varchar(255))
LOCATION <$datavol> ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;

create table PERSON_EVENT (EVENT_ID bigint not null, PERSON_ID bigint not null,
primary key (PERSON_ID, EVENT_ID)) LOCATION <$datavol> ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;

create unique index eventcat_events on EVENTS (EVENT_ID) LOCATION <$datavol>
ATTRIBUTE EXTENT (16, 64), MAXEXTENTS 160;

224 Customizing Sample Applications

Advertising
This manual is related to the following products: