Spring and hibernate applications – HP Integrity NonStop J-Series User Manual

Page 116

Advertising
background image

2.

Include Regex Patterns by creating the BrowseAccessIncludeExcludeList.xml
file, and add it to the CLASSPATH (place this file with hibernate.properties/
hibernate.cfg.xml

files). Copy the following into

BrowseAccessIncludeExcludeList.xml

file.

<?xml version="1.0" encoding="UTF-8"?>
<java version="1.6.0_22" class="java.beans.XMLDecoder">
<object class="org.hibernate.dialect.SqlmxInterceptor">
<void property="applyBrowseAccessTo">
<!-- INCLUDE LIST- Please Specify a regular expression
(regex pattern)here.You can specify more than one regex by
adding any number of method tags,for ex: <void
method="add"> <string>regex</string> </void>. If any of
these regex matches with the query browse access will be
enabled -->
<object class="java.util.ArrayList">
<void method=”add”>
<string>select.*</string>
</void>

<void method=”add”>
<string></string>
</void>
</object>
</void>
</object>
</java

By default, the interceptor intercepts all the select queries and enables Browse Access. If there
is a need to disable Browse Access for any of the tables or queries, update the
BrowseAccessIncludeExcludeList.xml

file.

Spring and Hibernate

Applications

For Spring and Hibernate applications, you can enable Browse Access through the
configuration as follows:
1.

Create a bean for the class org.hibernate.dialect.SqlmxInterceptor and inject
applyBrowseAccessTo

property with the Regex Patterns in the bean definition file.

For example:

<bean id="Interceptor"
class="org.hibernate.dialect.SqlmxInterceptor">
<property name="applyBrowseAccessTo">
<list>
<!--
INCLUDE LIST- Please Specify a regular expression
(regex pattern) here. You can specify more than one
regex by adding any number of value tags, for ex:
<value>regex</value>. If any of these regex
matches with the query browse access will be enabled
-->

<value>select.*</value>
</list>
</property>
</bean>

116

Hibernate Framework

Advertising
This manual is related to the following products: