I recently upgraded to Hibernate 3.0 from Hibernate 2.0 and one of the HQL queries I was running in 2.0 has busted quite catastrophically. Please see the information below.
Hibernate version:
3.0
Mapping documents:
Here are the relevant mapping documents for the query:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.sa.go.bto.Business" table="BUSINESS" proxy="com.sa.go.bto.Business">
<id name="id" column="BUSINESS_ID" type="java.lang.Long" unsaved-value="null">
<generator class="identity" />
</id>
<property name="name"
column="BUSINESS_NAME"
type="java.lang.String" />
<property name="taxId"
column="TAX_ID"
type="java.lang.String" />
<property name="websiteUrl"
column="SITE_URL"
type="java.lang.String" />
<property name="searchResultsUrl"
column="SEARCH_RESULTS_URL"
type="java.lang.String" />
<property name="nationalFlag"
column="NATIONAL_FLAG"
type="yes_no" />
<property name="onlineFlag"
column="ONLINE_FLAG"
type="yes_no" />
<many-to-one
name="affiliate"
column="ADMIN_CONTACT_ID"
class="com.sa.go.bto.Affiliate"
cascade="none"
outer-join="auto"
update="true"
insert="true"
not-null="false" />
<many-to-one
name="primaryRootCategory"
column="PRIMARY_ROOT_CATEGORY_ID"
class="com.sa.go.bto.Category"
cascade="none"
outer-join="auto"
update="true"
insert="true"
not-null="false" />
<many-to-one
name="activeJumpPage"
column="ACTIVE_BUSINESS_PJP_ID"
class="com.sa.go.bto.BusinessJumpPage"
cascade="all"
outer-join="auto"
update="true"
insert="true"
not-null="false" />
<many-to-one
name="activeMarketingPromotion"
column="ACTIVE_BUSINESS_MARKETING_ID"
class="com.sa.go.bto.MarketingPromotion"
cascade="all"
outer-join="auto"
update="true"
insert="true"
not-null="false" />
<set name="categories"
lazy="true"
inverse="false"
cascade="none"
table="BUSINESS_CATEGORY"
sort="com.sa.go.bto.config.BusinessRelationComparator">
<key column="BUSINESS_ID" />
<many-to-many
column="CATEGORY_ID"
class="com.sa.go.bto.Category"
outer-join="true" />
</set>
<set name="marketingPromotions"
lazy="true"
inverse="true"
cascade="all-delete-orphan"
sort="com.sa.go.bto.config.BusinessRelationComparator">
<key column="BUSINESS_ID" />
<one-to-many
class="com.sa.go.bto.MarketingPromotion" />
</set>
<set name="discounts"
lazy="true"
inverse="true"
cascade="all-delete-orphan"
sort="com.sa.go.bto.config.BusinessRelationComparator">
<key column="BUSINESS_ID" />
<one-to-many
class="com.sa.go.bto.Discount" />
</set>
<set name="jumpPages"
lazy="true"
inverse="true"
cascade="all-delete-orphan"
sort="com.sa.go.bto.config.BusinessRelationComparator">
<key column="BUSINESS_ID" />
<one-to-many
class="com.sa.go.bto.BusinessJumpPage" />
</set>
<bag name="keywords"
lazy="true"
inverse="false"
table="BUSINESS_KEYWORD"
cascade="all-delete-orphan"
order-by="KEYWORD ASC">
<key column="BUSINESS_ID" />
<element column="KEYWORD" type="string" />
</bag>
<set name="locations"
lazy="true"
inverse="true"
cascade="all-delete-orphan"
sort="com.sa.go.bto.config.BusinessRelationComparator">
<key column="BUSINESS_ID" />
<one-to-many
class="com.sa.go.bto.BusinessLocation" />
</set>
<set name="promotions"
lazy="true"
inverse="true"
cascade="all-delete-orphan"
sort="com.sa.go.bto.config.BusinessRelationComparator">
<key column="BUSINESS_ID" />
<one-to-many
class="com.sa.go.bto.Promotion" />
</set>
</class>
<!-- Returns all the businesses matching the given name in the database. -->
<!-- By default, the returned list is ordered by name. -->
<query name="com.sa.go.bto.Business.findByName"><![CDATA[
from com.sa.go.bto.Business as business
where upper(business.name) like upper(:name)
order by business.name
]]></query>
</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.sa.go.bto.BusinessJumpPage" table="BUSINESS_PJP" proxy="com.sa.go.bto.BusinessJumpPage">
<id name="id" column="BUSINESS_PJP_ID" type="java.lang.Long" unsaved-value="null">
<generator class="identity" />
</id>
<property name="name"
column="NAME"
type="java.lang.String" />
<property name="wssPageName"
column="WSS_PAGE_NAME"
type="java.lang.String" />
<property name="description"
column="DESCRIPTION"
type="java.lang.String" />
<property name="productMarketingHtml"
column="PRODUCT_MARKETING_HTML"
type="java.lang.String" />
<property name="adUrl"
column="AD_GRAPHIC_URL"
type="java.lang.String" />
<many-to-one
name="business"
column="BUSINESS_ID"
class="com.sa.go.bto.Business"
cascade="none"
outer-join="auto"
update="true"
insert="true"
not-null="true" />
<many-to-one
name="logo"
column="LOGO_GRAPHIC_ID"
class="com.sa.go.bto.Graphic"
cascade="all"
outer-join="auto"
update="true"
insert="true"
not-null="false" />
<many-to-one
name="ad"
column="AD_GRAPHIC_ID"
class="com.sa.go.bto.Graphic"
cascade="all"
outer-join="auto"
update="true"
insert="true"
not-null="false" />
<list name="discounts"
table="BUSINESS_PJP_DISCOUNT"
lazy="true"
cascade="none">
<key column="BUSINESS_PJP_ID" />
<index
column="SORT_ORDER" />
<many-to-many
column="DISCOUNT_ID"
class="com.sa.go.bto.Discount" />
</list>
</class>
</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.sa.go.bto.BusinessLocation" table="STORE_LOCATION" proxy="com.sa.go.bto.BusinessLocation">
<id name="id" column="LOCATION_ID" type="java.lang.Long" unsaved-value="null">
<generator class="identity" />
</id>
<property name="addressOne"
column="ADDRESS1"
type="java.lang.String" />
<property name="addressTwo"
column="ADDRESS2"
type="java.lang.String" />
<property name="addressThree"
column="ADDRESS3"
type="java.lang.String" />
<property name="addressFour"
column="ADDRESS4"
type="java.lang.String" />
<property name="city"
column="CITY"
type="java.lang.String" />
<property name="province"
column="PROVINCE_ID">
<type name="com.sa.go.util.EnumUserType">
<param name="enumClassName">com.sa.go.bto.enumeration.Province</param>
</type>
</property>
<property name="zipCode"
column="POSTAL_CODE"
type="java.lang.String" />
<property name="phoneNumber"
column="LOCATION_PHONE"
type="java.lang.String" />
<property name="topPickFlag"
column="TOP_PICK_FLAG"
type="yes_no" />
<property name="url"
column="SITE_URL"
type="java.lang.String" />
<many-to-one
name="localMarketingPromotion"
column="LOCAL_BUSINESS_MARKETING_ID"
class="com.sa.go.bto.MarketingPromotion"
cascade="none"
outer-join="auto"
update="true"
insert="true"
not-null="false" />
<many-to-one
name="business"
column="BUSINESS_ID"
class="com.sa.go.bto.Business"
cascade="none"
outer-join="auto"
update="true"
insert="true"
not-null="true" />
<set name="discounts"
lazy="true"
inverse="false"
cascade="none"
table="STORE_LOCATION_DISCOUNT"
sort="com.sa.go.bto.config.BusinessLocationRelationComparator">
<key column="LOCATION_ID" />
<many-to-many
column="DISCOUNT_ID"
class="com.sa.go.bto.Discount"
outer-join="true" />
</set>
</class>
<!-- Returns a specific business location from the database. -->
<query name="com.sa.go.bto.BusinessLocation.specific"><![CDATA[
from com.sa.go.bto.BusinessLocation as location where location.id = :id
]]></query>
<!-- Retrieves all locations for a business along with the business -->
<!-- itself *and* all discounts tied to each location. -->
<query name="com.sa.go.bto.BusinessLocation.findLocationsForBusiness"><![CDATA[
select location
from com.sa.go.bto.BusinessLocation location
inner join fetch location.business business
inner join fetch location.discounts discount
where business.id = :businessId
]]></query>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():This is the only HQL query being performed:
Code:
select distinct location from com.sa.go.bto.BusinessLocation location
inner join fetch location.business as business
left outer join fetch business.activeJumpPage jumpPage
inner join business.keywords as keyword
where location.zipCode in (:zipCodes) and
upper(keyword) like upper(:keyword)
The java code:
Code:
Query query = s.createQuery(hql);
query.setParameter("keyword", c.getKeyword() + "%");
query.setParameterList("zipCodes", zipCodes);
List h = query.list();
It fails on the "list()" call.
Full stack trace of any exception that occurs:Code:
java.lang.NullPointerException
at org.hibernate.loader.GeneratedCollectionAliases.<init>(GeneratedCollectionAliases.java:21)
at org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:50)
at org.hibernate.loader.hql.QueryLoader.<init>(QueryLoader.java:93)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:152)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
Name and version of the database you are using:
MySQL 4
The generated SQL (show_sql=true):
Hibernate appears to be dying before it can print out the SQL.
Debug level Hibernate log excerpt:
There were LOTS of org.hibernate.type lines that I filtered out here for the sake of brevity. Hopefully this is enough for you guys to go on:
[code]
2005-06-16 19:15:47,718 [Thread-10] DEBUG org.hibernate.impl.SessionImpl - find: select distinct business from com.sa.go.bto.Business business left outer join fetch business.activeJumpPage jumpPage left outer join fetch jumpPage.ad left outer join fetch jumpPage.logo inner join business.keywords as keyword where (business.nationalFlag = YES or business.onlineFlag = YES) and upper(keyword) like upper(:keyword)
2005-06-16 19:15:47,718 [Thread-10] DEBUG org.hibernate.engine.QueryParameters - named parameters: {keyword=pizza%}
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.QueryTranslatorImpl - parse() - HQL: select distinct business from com.sa.go.bto.Business business left outer join fetch business.activeJumpPage jumpPage left outer join fetch jumpPage.ad left outer join fetch jumpPage.logo inner join business.keywords as keyword where (business.nationalFlag = YES or business.onlineFlag = YES) and upper(keyword) like upper(:keyword)
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.AST - --- HQL AST ---
\-[QUERY] 'query'
+-[SELECT_FROM] 'SELECT_FROM'
| +-[FROM] 'from'
| | +-[RANGE] 'RANGE'
| | | +-[DOT] '.'
| | | | +-[DOT] '.'
| | | | | +-[DOT] '.'
| | | | | | +-[DOT] '.'
| | | | | | | +-[IDENT] 'com'
| | | | | | | \-[IDENT] 'sa'
| | | | | | \-[IDENT] 'go'
| | | | | \-[IDENT] 'bto'
| | | | \-[IDENT] 'Business'
| | | \-[ALIAS] 'business'
| | +-[JOIN] 'join'
| | | +-[LEFT] 'left'
| | | +-[OUTER] 'outer'
| | | +-[FETCH] 'fetch'
| | | +-[DOT] '.'
| | | | +-[IDENT] 'business'
| | | | \-[IDENT] 'activeJumpPage'
| | | \-[ALIAS] 'jumpPage'
| | +-[JOIN] 'join'
| | | +-[LEFT] 'left'
| | | +-[OUTER] 'outer'
| | | +-[FETCH] 'fetch'
| | | \-[DOT] '.'
| | | +-[IDENT] 'jumpPage'
| | | \-[IDENT] 'ad'
| | +-[JOIN] 'join'
| | | +-[LEFT] 'left'
| | | +-[OUTER] 'outer'
| | | +-[FETCH] 'fetch'
| | | \-[DOT] '.'
| | | +-[IDENT] 'jumpPage'
| | | \-[IDENT] 'logo'
| | \-[JOIN] 'join'
| | +-[INNER] 'inner'
| | +-[DOT] '.'
| | | +-[IDENT] 'business'
| | | \-[IDENT] 'keywords'
| | \-[ALIAS] 'keyword'
| \-[SELECT] 'select'
| +-[DISTINCT] 'distinct'
| \-[IDENT] 'business'
\-[WHERE] 'where'
\-[AND] 'and'
+-[OR] 'or'
| +-[EQ] '='
| | +-[DOT] '.'
| | | +-[IDENT] 'business'
| | | \-[IDENT] 'nationalFlag'
| | \-[IDENT] 'YES'
| \-[EQ] '='
| +-[DOT] '.'
| | +-[IDENT] 'business'
| | \-[IDENT] 'onlineFlag'
| \-[IDENT] 'YES'
\-[LIKE] 'like'
+-[METHOD_CALL] '('
| +-[IDENT] 'upper'
| \-[EXPR_LIST] 'exprList'
| \-[IDENT] 'keyword'
\-[METHOD_CALL] '('
+-[IDENT] 'upper'
\-[EXPR_LIST] 'exprList'
\-[COLON] ':'
\-[IDENT] 'keyword'
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.ErrorCounter - throwQueryException() : no errors
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.antlr.HqlSqlBaseWalker - query() << begin, level = 1
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.FromElement - FromClause{level=1} : com.sa.go.bto.Business (business) -> business0_
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : business -> business0_.BUSINESS_ID
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.DotNode - getDataType() : activeJumpPage -> org.hibernate.type.ManyToOneType(com.sa.go.bto.BusinessJumpPage)
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.DotNode - dereferenceEntityJoin() : generating join for activeJumpPage in com.sa.go.bto.Business (jumpPage) parent = [ {null} ]
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.FromElement - FromClause{level=1} : com.sa.go.bto.BusinessJumpPage (jumpPage) -> businessju1_
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.FromClause - addJoinByPathMap() : business.activeJumpPage -> BUSINESS_PJP businessju1_
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : business.activeJumpPage -> business0_.ACTIVE_BUSINESS_PJP_ID
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.HqlSqlWalker - createFromJoinElement() : -- join tree --
\-[JOIN_FRAGMENT] FromElement: 'BUSINESS_PJP businessju1_' FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=jumpPage,role=null,tableName=BUSINESS_PJP,tableAlias=businessju1_,colums={business0_.ACTIVE_BUSINESS_PJP_ID ,className=com.sa.go.bto.BusinessJumpPage}}
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : jumpPage -> businessju1_.BUSINESS_PJP_ID
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.DotNode - getDataType() : ad -> org.hibernate.type.ManyToOneType(com.sa.go.bto.Graphic)
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.DotNode - dereferenceEntityJoin() : generating join for ad in com.sa.go.bto.BusinessJumpPage {no alias} parent = [ {null} ]
2005-06-16 19:15:47,734 [Thread-10] DEBUG org.hibernate.hql.ast.FromElement - FromClause{level=1} : com.sa.go.bto.Graphic (no alias) -> graphic2_
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromClause - addJoinByPathMap() : jumpPage.ad -> GRAPHIC graphic2_
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : jumpPage.ad -> businessju1_.AD_GRAPHIC_ID
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.HqlSqlWalker - createFromJoinElement() : -- join tree --
\-[JOIN_FRAGMENT] FromElement: 'GRAPHIC graphic2_' FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=GRAPHIC,tableAlias=graphic2_,colums={businessju1_.AD_GRAPHIC_ID ,className=com.sa.go.bto.Graphic}}
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : jumpPage -> businessju1_.BUSINESS_PJP_ID
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.DotNode - getDataType() : logo -> org.hibernate.type.ManyToOneType(com.sa.go.bto.Graphic)
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.DotNode - dereferenceEntityJoin() : generating join for logo in com.sa.go.bto.BusinessJumpPage {no alias} parent = [ {null} ]
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromElement - FromClause{level=1} : com.sa.go.bto.Graphic (no alias) -> graphic3_
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromClause - addJoinByPathMap() : jumpPage.logo -> GRAPHIC graphic3_
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : jumpPage.logo -> businessju1_.LOGO_GRAPHIC_ID
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.HqlSqlWalker - createFromJoinElement() : -- join tree --
\-[JOIN_FRAGMENT] FromElement: 'GRAPHIC graphic3_' FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=GRAPHIC,tableAlias=graphic3_,colums={businessju1_.LOGO_GRAPHIC_ID ,className=com.sa.go.bto.Graphic}}
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : business -> business0_.BUSINESS_ID
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.DotNode - getDataType() : keywords -> org.hibernate.type.BagType(com.sa.go.bto.Business.keywords)
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromElement - FromClause{level=1} : null (keyword) -> keywords4_
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromClause - addCollectionJoinFromElementByPath() : business.keywords -> BUSINESS_KEYWORD
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.DotNode - dereferenceCollection() : Created new FROM element for business.keywords : BUSINESS_KEYWORD keywords4_
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : business.keywords -> .
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.HqlSqlWalker - createFromJoinElement() : -- join tree --
\-[JOIN_FRAGMENT] FromElement: 'BUSINESS_KEYWORD keywords4_' FromElement{explicit,collection join,not a fetch join,fetch non-lazy properties,classAlias=keyword,role=com.sa.go.bto.Business.keywords,tableName={none},tableAlias=keywords4_,colums={,className=null}}
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : business -> business0_.BUSINESS_ID
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : business -> business0_.BUSINESS_ID
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.DotNode - getDataType() : nationalFlag -> org.hibernate.type.YesNoType@147e54e
2005-06-16 19:15:47,750 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : business.nationalFlag -> business0_.NATIONAL_FLAG
2005-06-16 19:15:47,765 [Thread-10] DEBUG org.hibernate.hql.ast.LiteralProcessor - processConstant() : Replacing 'YES' with ''Y''
2005-06-16 19:15:47,765 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : business -> business0_.BUSINESS_ID
2005-06-16 19:15:47,765 [Thread-10] DEBUG org.hibernate.hql.ast.DotNode - getDataType() : onlineFlag -> org.hibernate.type.YesNoType@147e54e
2005-06-16 19:15:47,765 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : business.onlineFlag -> business0_.ONLINE_FLAG
2005-06-16 19:15:47,765 [Thread-10] DEBUG org.hibernate.hql.ast.LiteralProcessor - processConstant() : Replacing 'YES' with ''Y''
2005-06-16 19:15:47,765 [Thread-10] DEBUG org.hibernate.hql.ast.FromReferenceNode - Resolved : keyword -> keywords4_.KEYWORD
2005-06-16 19:15:47,765 [Thread-10] DEBUG org.hibernate.hql.antlr.HqlSqlBaseWalker - query() : finishing up , level = 1
2005-06-16 19:15:47,765 [Thread-10] DEBUG org.hibernate.hql.ast.HqlSqlWalker - processQuery() : ( SELECT ( {select clause} distinct business0_.BUSINESS_ID ) ( FromClause{level=1} ( ( BUSINESS_PJP businessju1_ GRAPHIC graphic2_ GRAPHIC graphic3_ ) BUSINESS_KEYWORD keywords4_ ) ) ( where ( and ( or ( = ( business0_.NATIONAL_FLAG business0_.BUSINESS_ID nationalFlag ) 'Y' ) ( = ( business0_.ONLINE_FLAG business0_.BUSINESS_ID onlineFlag ) 'Y' ) ) ( like ( ( upper ( exprList keywords4_.KEYWORD ) ) ( ( upper ( exprList ? ) ) ) ) ) )
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.ast.JoinProcessor - Using FROM fragment [inner join BUSINESS_KEYWORD keywords4_ on business0_.BUSINESS_ID=keywords4_.BUSINESS_ID]
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.ast.JoinProcessor - Using FROM fragment [left outer join GRAPHIC graphic3_ on businessju1_.LOGO_GRAPHIC_ID=graphic3_.GRAPHIC_ID]
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.ast.JoinProcessor - Using FROM fragment [left outer join GRAPHIC graphic2_ on businessju1_.AD_GRAPHIC_ID=graphic2_.GRAPHIC_ID]
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.ast.JoinProcessor - Using FROM fragment [left outer join BUSINESS_PJP businessju1_ on business0_.ACTIVE_BUSINESS_PJP_ID=businessju1_.BUSINESS_PJP_ID]
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.ast.JoinProcessor - Using FROM fragment [BUSINESS business0_]
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.antlr.HqlSqlBaseWalker - query() >> end, level = 1
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.ast.AST - --- SQL AST ---
\-[SELECT] QueryNode: 'SELECT' querySpaces (BUSINESS,BUSINESS_PJP,BUSINESS_KEYWORD,GRAPHIC)
+-[SELECT_CLAUSE] SelectClause: '{select clause}'
| +-[DISTINCT] SqlNode: 'distinct'
| +-[ALIAS_REF] IdentNode: 'business0_.BUSINESS_ID as BUSINESS1_0_' {alias=business, className=com.sa.go.bto.Business, tableAlias=business0_}
| +-[SELECT_EXPR] SelectExpressionImpl: 'businessju1_.BUSINESS_PJP_ID as BUSINESS1_1_' {FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=jumpPage,role=null,tableName=BUSINESS_PJP,tableAlias=businessju1_,colums={business0_.ACTIVE_BUSINESS_PJP_ID ,className=com.sa.go.bto.BusinessJumpPage}}}
| +-[SELECT_EXPR] SelectExpressionImpl: 'graphic2_.GRAPHIC_ID as GRAPHIC1_2_' {FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=GRAPHIC,tableAlias=graphic2_,colums={businessju1_.AD_GRAPHIC_ID ,className=com.sa.go.bto.Graphic}}}
| +-[SELECT_EXPR] SelectExpressionImpl: 'graphic3_.GRAPHIC_ID as GRAPHIC1_3_' {FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=GRAPHIC,tableAlias=graphic3_,colums={businessju1_.LOGO_GRAPHIC_ID ,className=com.sa.go.bto.Graphic}}}
| +-[SQL_TOKEN] SqlFragment: 'business0_.BUSINESS_NAME as BUSINESS2_2_0_, business0_.TAX_ID as TAX3_2_0_, business0_.SITE_URL as SITE4_2_0_, business0_.SEARCH_RESULTS_URL as SEARCH5_2_0_, business0_.NATIONAL_FLAG as NATIONAL6_2_0_, business0_.ONLINE_FLAG as ONLINE7_2_0_, business0_.ADMIN_CONTACT_ID as ADMIN8_2_0_, business0_.PRIMARY_ROOT_CATEGORY_ID as PRIMARY9_2_0_, business0_.ACTIVE_BUSINESS_PJP_ID as ACTIVE10_2_0_, business0_.ACTIVE_BUSINESS_MARKETING_ID as ACTIVE11_2_0_'
| +-[SQL_TOKEN] SqlFragment: 'businessju1_.NAME as NAME5_1_, businessju1_.WSS_PAGE_NAME as WSS3_5_1_, businessju1_.DESCRIPTION as DESCRIPT4_5_1_, businessju1_.PRODUCT_MARKETING_HTML as PRODUCT5_5_1_, businessju1_.AD_GRAPHIC_URL as AD6_5_1_, businessju1_.BUSINESS_ID as BUSINESS7_5_1_, businessju1_.LOGO_GRAPHIC_ID as LOGO8_5_1_, businessju1_.AD_GRAPHIC_ID as AD9_5_1_'
| +-[SQL_TOKEN] SqlFragment: 'graphic2_.FILENAME as FILENAME17_2_, graphic2_.CONTENT_TYPE as CONTENT3_17_2_, graphic2_.WIDTH as WIDTH17_2_, graphic2_.HEIGHT as HEIGHT17_2_'
| \-[SQL_TOKEN] SqlFragment: 'graphic3_.FILENAME as FILENAME17_3_, graphic3_.CONTENT_TYPE as CONTENT3_17_3_, graphic3_.WIDTH as WIDTH17_3_, graphic3_.HEIGHT as HEIGHT17_3_'
+-[FROM] FromClause: 'from' FromClause{level=1, fromElementCounter=4, fromElements=5, fromElementByClassAlias=[keyword, jumpPage, business], fromElementByTableAlias=[graphic3_, graphic2_, businessju1_, business0_, keywords4_], fromElementsByPath=[jumpPage.logo, business.activeJumpPage, jumpPage.ad], collectionJoinFromElementsByPath=[business.keywords], impliedElements=[]}
| \-[FROM_FRAGMENT] FromElement: 'BUSINESS business0_' FromElement{explicit,collection join,not a fetch join,fetch non-lazy properties,classAlias=business,role=null,tableName=BUSINESS,tableAlias=business0_,colums={,className=com.sa.go.bto.Business}}
| +-[JOIN_FRAGMENT] FromElement: 'left outer join BUSINESS_PJP businessju1_ on business0_.ACTIVE_BUSINESS_PJP_ID=businessju1_.BUSINESS_PJP_ID' FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=jumpPage,role=null,tableName=BUSINESS_PJP,tableAlias=businessju1_,colums={business0_.ACTIVE_BUSINESS_PJP_ID ,className=com.sa.go.bto.BusinessJumpPage}}
| | +-[JOIN_FRAGMENT] FromElement: 'left outer join GRAPHIC graphic2_ on businessju1_.AD_GRAPHIC_ID=graphic2_.GRAPHIC_ID' FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=GRAPHIC,tableAlias=graphic2_,colums={businessju1_.AD_GRAPHIC_ID ,className=com.sa.go.bto.Graphic}}
| | \-[JOIN_FRAGMENT] FromElement: 'left outer join GRAPHIC graphic3_ on businessju1_.LOGO_GRAPHIC_ID=graphic3_.GRAPHIC_ID' FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=GRAPHIC,tableAlias=graphic3_,colums={businessju1_.LOGO_GRAPHIC_ID ,className=com.sa.go.bto.Graphic}}
| \-[JOIN_FRAGMENT] FromElement: 'inner join BUSINESS_KEYWORD keywords4_ on business0_.BUSINESS_ID=keywords4_.BUSINESS_ID' FromElement{explicit,collection join,not a fetch join,fetch non-lazy properties,classAlias=keyword,role=com.sa.go.bto.Business.keywords,tableName={none},tableAlias=keywords4_,colums={,className=null}}
\-[WHERE] SqlNode: 'where'
\-[AND] SqlNode: 'and'
+-[OR] SqlNode: 'or'
| +-[EQ] SqlNode: '='
| | +-[DOT] DotNode: 'business0_.NATIONAL_FLAG' {propertyName=nationalFlag,dereferenceType=4,propertyPath=nationalFlag,path=business.nationalFlag,tableAlias=business0_,className=com.sa.go.bto.Business,classAlias=business}
| | | +-[ALIAS_REF] IdentNode: 'business0_.BUSINESS_ID' {alias=business, className=com.sa.go.bto.Business, tableAlias=business0_}
| | | \-[IDENT] IdentNode: 'nationalFlag' {originalText=nationalFlag}
| | \-[IDENT] IdentNode: ''Y'' {originalText=YES}
| \-[EQ] SqlNode: '='
| +-[DOT] DotNode: 'business0_.ONLINE_FLAG' {propertyName=onlineFlag,dereferenceType=4,propertyPath=onlineFlag,path=business.onlineFlag,tableAlias=business0_,className=com.sa.go.bto.Business,classAlias=business}
| | +-[ALIAS_REF] IdentNode: 'business0_.BUSINESS_ID' {alias=business, className=com.sa.go.bto.Business, tableAlias=business0_}
| | \-[IDENT] IdentNode: 'onlineFlag' {originalText=onlineFlag}
| \-[IDENT] IdentNode: ''Y'' {originalText=YES}
\-[LIKE] SqlNode: 'like'
+-[METHOD_CALL] MethodNode: '('
| +-[METHOD_NAME] IdentNode: 'upper' {originalText=upper}
| \-[EXPR_LIST] SqlNode: 'exprList'
| \-[ALIAS_REF] IdentNode: 'keywords4_.KEYWORD' {alias=keyword, className=null, tableAlias=keywords4_}
\-[METHOD_CALL] MethodNode: '('
+-[METHOD_NAME] IdentNode: 'upper' {originalText=upper}
\-[EXPR_LIST] SqlNode: 'exprList'
\-[NAMED_PARAM] SqlNode: '?'
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.ast.ErrorCounter - throwQueryException() : no errors
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.ast.QueryTranslatorImpl - HQL: select distinct business from com.sa.go.bto.Business business left outer join fetch business.activeJumpPage jumpPage left outer join fetch jumpPage.ad left outer join fetch jumpPage.logo inner join business.keywords as keyword where (business.nationalFlag = YES or business.onlineFlag = YES) and upper(keyword) like upper(:keyword)
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.ast.QueryTranslatorImpl - SQL: select distinct business0_.BUSINESS_ID as BUSINESS1_0_, businessju1_.BUSINESS_PJP_ID as BUSINESS1_1_, graphic2_.GRAPHIC_ID as GRAPHIC1_2_, graphic3_.GRAPHIC_ID as GRAPHIC1_3_, business0_.BUSINESS_NAME as BUSINESS2_2_0_, business0_.TAX_ID as TAX3_2_0_, business0_.SITE_URL as SITE4_2_0_, business0_.SEARCH_RESULTS_URL as SEARCH5_2_0_, business0_.NATIONAL_FLAG as NATIONAL6_2_0_, business0_.ONLINE_FLAG as ONLINE7_2_0_, business0_.ADMIN_CONTACT_ID as ADMIN8_2_0_, business0_.PRIMARY_ROOT_CATEGORY_ID as PRIMARY9_2_0_, business0_.ACTIVE_BUSINESS_PJP_ID as ACTIVE10_2_0_, business0_.ACTIVE_BUSINESS_MARKETING_ID as ACTIVE11_2_0_, businessju1_.NAME as NAME5_1_, businessju1_.WSS_PAGE_NAME as WSS3_5_1_, businessju1_.DESCRIPTION as DESCRIPT4_5_1_, businessju1_.PRODUCT_MARKETING_HTML as PRODUCT5_5_1_, businessju1_.AD_GRAPHIC_URL as AD6_5_1_, businessju1_.BUSINESS_ID as BUSINESS7_5_1_, businessju1_.LOGO_GRAPHIC_ID as LOGO8_5_1_, businessju1_.AD_GRAPHIC_ID as AD9_5_1_, graphic2_.FILENAME as FILENAME17_2_, graphic2_.CONTENT_TYPE as CONTENT3_17_2_, graphic2_.WIDTH as WIDTH17_2_, graphic2_.HEIGHT as HEIGHT17_2_, graphic3_.FILENAME as FILENAME17_3_, graphic3_.CONTENT_TYPE as CONTENT3_17_3_, graphic3_.WIDTH as WIDTH17_3_, graphic3_.HEIGHT as HEIGHT17_3_ from BUSINESS business0_ left outer join BUSINESS_PJP businessju1_ on business0_.ACTIVE_BUSINESS_PJP_ID=businessju1_.BUSINESS_PJP_ID left outer join GRAPHIC graphic2_ on businessju1_.AD_GRAPHIC_ID=graphic2_.GRAPHIC_ID left outer join GRAPHIC graphic3_ on businessju1_.LOGO_GRAPHIC_ID=graphic3_.GRAPHIC_ID inner join BUSINESS_KEYWORD keywords4_ on business0_.BUSINESS_ID=keywords4_.BUSINESS_ID where (business0_.NATIONAL_FLAG='Y' or business0_.ONLINE_FLAG='Y') and (upper(keywords4_.KEYWORD)like upper(?))
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.hql.ast.ErrorCounter - throwQueryException() : no errors
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - flushing session
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
2005-06-16 19:15:47,781 [Thread-10] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
2005-06-16 19:15:47,796 [Thread-10] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 insertions, 0 updates, 0 deletions to 42675 objects
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - listing entities:
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=U, longitude=-1.28734, timeZone=EST, areaCode=518, zipCode=12111, daylightSavingsFlag=true, countyName=Albany, countyFips=36001, latitude=0.746069, cityName=Latham, stateCode=NY, id=175492}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.68534, timeZone=CST, areaCode=972, zipCode=75159, daylightSavingsFlag=true, countyName=Dallas, countyFips=48113, latitude=0.569655, cityName=Seagoville, stateCode=TX, id=204008}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.50028, timeZone=CST, areaCode=256, zipCode=35010, daylightSavingsFlag=true, countyName=Tallapoosa, countyFips=01123, latitude=0.574817, cityName=Alexander City, stateCode=AL, id=186430}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.55134, timeZone=CST, areaCode=815, zipCode=60550, daylightSavingsFlag=true, countyName=De Kalb, countyFips=17037, latitude=0.72874, cityName=Shabbona, stateCode=IL, id=197802}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=P, longitude=-1.42651, timeZone=EST, areaCode=863, zipCode=33883, daylightSavingsFlag=true, countyName=Polk, countyFips=12105, latitude=0.489073, cityName=Winter Haven, stateCode=FL, id=186060}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=P, longitude=-1.59184, timeZone=CST, areaCode=715, zipCode=54760, daylightSavingsFlag=true, countyName=Trempealeau, countyFips=55121, latitude=0.775371, cityName=Pigeon Falls, stateCode=WI, id=195099}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=U, longitude=-2.11446, timeZone=PST, areaCode=916, zipCode=95671, daylightSavingsFlag=true, countyName=Sacramento, countyFips=06067, latitude=0.674978, cityName=Represa, stateCode=CA, id=211635}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=P, longitude=-2.13116, timeZone=PST, areaCode=831, zipCode=95007, daylightSavingsFlag=true, countyName=Santa Cruz, countyFips=06087, latitude=0.647638, cityName=Brookdale, stateCode=CA, id=211191}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=U, longitude=-1.41098, timeZone=EST, areaCode=704, zipCode=28258, daylightSavingsFlag=true, countyName=Mecklenburg, countyFips=37119, latitude=0.614822, cityName=Charlotte, stateCode=NC, id=182948}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.4262, timeZone=EST, areaCode=304, zipCode=24832, daylightSavingsFlag=true, countyName=McDowell, countyFips=54047, latitude=0.651664, cityName=English, stateCode=WV, id=181428}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=P, longitude=-1.31019, timeZone=EST, areaCode=607, zipCode=13837, daylightSavingsFlag=true, countyName=Delaware, countyFips=36025, latitude=0.733712, cityName=Shinhopple, stateCode=NY, id=176416}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.38262, timeZone=EST, areaCode=540, zipCode=24483, daylightSavingsFlag=true, countyName=Rockbridge, countyFips=51163, latitude=0.659879, cityName=Vesuvius, stateCode=VA, id=181283}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.54924, timeZone=CST, areaCode=618, zipCode=62985, daylightSavingsFlag=true, countyName=Johnson, countyFips=17087, latitude=0.653942, cityName=Simpson, stateCode=IL, id=199078}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.5674, timeZone=CST, areaCode=573, zipCode=63846, daylightSavingsFlag=true, countyName=Stoddard, countyFips=29207, latitude=0.642339, cityName=Essex, stateCode=MO, id=199455}
2005-06-16 19:15:47,984 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=U, longitude=-1.40227, timeZone=EST, areaCode=304, zipCode=26306, daylightSavingsFlag=true, countyName=Harrison, countyFips=54033, latitude=0.685502, cityName=Clarksburg, stateCode=WV, id=182104}
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.31526, timeZone=EST, areaCode=315, zipCode=13680, daylightSavingsFlag=true, countyName=Saint Lawrence, countyFips=36089, latitude=0.777516, cityName=Rensselaer Falls, stateCode=NY, id=176330}
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.34628, timeZone=EST, areaCode=301, zipCode=20855, daylightSavingsFlag=true, countyName=Montgomery, countyFips=24031, latitude=0.683115, cityName=Derwood, stateCode=MD, id=179771}
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.29507, timeZone=EST, areaCode=732, zipCode=08722, daylightSavingsFlag=true, countyName=Ocean, countyFips=34029, latitude=0.696872, cityName=Beachwood, stateCode=NJ, id=174263}
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.49258, timeZone=EST, areaCode=765, zipCode=47384, daylightSavingsFlag=false, countyName=Henry, countyFips=18065, latitude=0.696709, cityName=Shirley, stateCode=IN, id=191784}
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.50133, timeZone=CST, areaCode=615, zipCode=38563, daylightSavingsFlag=true, countyName=Smith, countyFips=47159, latitude=0.631519, cityName=Gordonsville, stateCode=TN, id=188052}
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.pretty.Printer - com.sa.go.bto.ZipCode{zipCodeType=null, longitude=-1.51607, timeZone=CST, areaCode=219, zipCode=46390, daylightSavingsFlag=true, countyName=La Porte, countyFips=18091, latitude=0.722727, cityName=Wanatah, stateCode=IN, id=191337}
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.pretty.Printer - more......
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.event.def.DefaultAutoFlushEventListener - Dont need to execute flush
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.SQL - select distinct business0_.BUSINESS_ID as BUSINESS1_0_, businessju1_.BUSINESS_PJP_ID as BUSINESS1_1_, graphic2_.GRAPHIC_ID as GRAPHIC1_2_, graphic3_.GRAPHIC_ID as GRAPHIC1_3_, business0_.BUSINESS_NAME as BUSINESS2_2_0_, business0_.TAX_ID as TAX3_2_0_, business0_.SITE_URL as SITE4_2_0_, business0_.SEARCH_RESULTS_URL as SEARCH5_2_0_, business0_.NATIONAL_FLAG as NATIONAL6_2_0_, business0_.ONLINE_FLAG as ONLINE7_2_0_, business0_.ADMIN_CONTACT_ID as ADMIN8_2_0_, business0_.PRIMARY_ROOT_CATEGORY_ID as PRIMARY9_2_0_, business0_.ACTIVE_BUSINESS_PJP_ID as ACTIVE10_2_0_, business0_.ACTIVE_BUSINESS_MARKETING_ID as ACTIVE11_2_0_, businessju1_.NAME as NAME5_1_, businessju1_.WSS_PAGE_NAME as WSS3_5_1_, businessju1_.DESCRIPTION as DESCRIPT4_5_1_, businessju1_.PRODUCT_MARKETING_HTML as PRODUCT5_5_1_, businessju1_.AD_GRAPHIC_URL as AD6_5_1_, businessju1_.BUSINESS_ID as BUSINESS7_5_1_, businessju1_.LOGO_GRAPHIC_ID as LOGO8_5_1_, businessju1_.AD_GRAPHIC_ID as AD9_5_1_, graphic2_.FILENAME as FILENAME17_2_, graphic2_.CONTENT_TYPE as CONTENT3_17_2_, graphic2_.WIDTH as WIDTH17_2_, graphic2_.HEIGHT as HEIGHT17_2_, graphic3_.FILENAME as FILENAME17_3_, graphic3_.CONTENT_TYPE as CONTENT3_17_3_, graphic3_.WIDTH as WIDTH17_3_, graphic3_.HEIGHT as HEIGHT17_3_ from BUSINESS business0_ left outer join BUSINESS_PJP businessju1_ on business0_.ACTIVE_BUSINESS_PJP_ID=businessju1_.BUSINESS_PJP_ID left outer join GRAPHIC graphic2_ on businessju1_.AD_GRAPHIC_ID=graphic2_.GRAPHIC_ID left outer join GRAPHIC graphic3_ on businessju1_.LOGO_GRAPHIC_ID=graphic3_.GRAPHIC_ID inner join BUSINESS_KEYWORD keywords4_ on business0_.BUSINESS_ID=keywords4_.BUSINESS_ID where (business0_.NATIONAL_FLAG='Y' or business0_.ONLINE_FLAG='Y') and (upper(keywords4_.KEYWORD)like upper(?))
Hibernate: select distinct business0_.BUSINESS_ID as BUSINESS1_0_, businessju1_.BUSINESS_PJP_ID as BUSINESS1_1_, graphic2_.GRAPHIC_ID as GRAPHIC1_2_, graphic3_.GRAPHIC_ID as GRAPHIC1_3_, business0_.BUSINESS_NAME as BUSINESS2_2_0_, business0_.TAX_ID as TAX3_2_0_, business0_.SITE_URL as SITE4_2_0_, business0_.SEARCH_RESULTS_URL as SEARCH5_2_0_, business0_.NATIONAL_FLAG as NATIONAL6_2_0_, business0_.ONLINE_FLAG as ONLINE7_2_0_, business0_.ADMIN_CONTACT_ID as ADMIN8_2_0_, business0_.PRIMARY_ROOT_CATEGORY_ID as PRIMARY9_2_0_, business0_.ACTIVE_BUSINESS_PJP_ID as ACTIVE10_2_0_, business0_.ACTIVE_BUSINESS_MARKETING_ID as ACTIVE11_2_0_, businessju1_.NAME as NAME5_1_, businessju1_.WSS_PAGE_NAME as WSS3_5_1_, businessju1_.DESCRIPTION as DESCRIPT4_5_1_, businessju1_.PRODUCT_MARKETING_HTML as PRODUCT5_5_1_, businessju1_.AD_GRAPHIC_URL as AD6_5_1_, businessju1_.BUSINESS_ID as BUSINESS7_5_1_, businessju1_.LOGO_GRAPHIC_ID as LOGO8_5_1_, businessju1_.AD_GRAPHIC_ID as AD9_5_1_, graphic2_.FILENAME as FILENAME17_2_, graphic2_.CONTENT_TYPE as CONTENT3_17_2_, graphic2_.WIDTH as WIDTH17_2_, graphic2_.HEIGHT as HEIGHT17_2_, graphic3_.FILENAME as FILENAME17_3_, graphic3_.CONTENT_TYPE as CONTENT3_17_3_, graphic3_.WIDTH as WIDTH17_3_, graphic3_.HEIGHT as HEIGHT17_3_ from BUSINESS business0_ left outer join BUSINESS_PJP businessju1_ on business0_.ACTIVE_BUSINESS_PJP_ID=businessju1_.BUSINESS_PJP_ID left outer join GRAPHIC graphic2_ on businessju1_.AD_GRAPHIC_ID=graphic2_.GRAPHIC_ID left outer join GRAPHIC graphic3_ on businessju1_.LOGO_GRAPHIC_ID=graphic3_.GRAPHIC_ID inner join BUSINESS_KEYWORD keywords4_ on business0_.BUSINESS_ID=keywords4_.BUSINESS_ID where (business0_.NATIONAL_FLAG='Y' or business0_.ONLINE_FLAG='Y') and (upper(keywords4_.KEYWORD)like upper(?))
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
2005-06-16 19:15:48,000 [Thread-10] DEBUG org.hibernate.loader.hql.QueryLoader - bindNamedParameters() pizza% -> keyword [1]
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.loader.Loader - processing result set
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.loader.Loader - result set row: 0
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.loader.Loader - result row: EntityKey[com.sa.go.bto.Business#5728], EntityKey[com.sa.go.bto.BusinessJumpPage#7157], EntityKey[com.sa.go.bto.Graphic#3342], EntityKey[com.sa.go.bto.Graphic#2989]
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.loader.Loader - Initializing object from ResultSet: [com.sa.go.bto.Business#5728]
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Hydrating entity: [com.sa.go.bto.Business#5728]
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.loader.Loader - Initializing object from ResultSet: [com.sa.go.bto.BusinessJumpPage#7157]
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Hydrating entity: [com.sa.go.bto.BusinessJumpPage#7157]
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.loader.Loader - Initializing object from ResultSet: [com.sa.go.bto.Graphic#3342]
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Hydrating entity: [com.sa.go.bto.Graphic#3342]
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.loader.Loader - Initializing object from ResultSet: [com.sa.go.bto.Graphic#2989]
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Hydrating entity: [com.sa.go.bto.Graphic#2989]
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.loader.Loader - done processing result set (1 rows)
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close ResultSet (open ResultSets: 1, globally: 1)
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.jdbc.AbstractBatcher - closing statement
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.loader.Loader - total objects hydrated: 4
2005-06-16 19:15:48,250 [Thread-10] DEBUG org.hibernate.engine.TwoPhaseLoad - resolving associations for [com.sa.go.bto.Business#5728]
2005-06-16 19:15:48,265 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - loading entity: [com.sa.go.bto.Category#9]
2005-06-16 19:15:48,265 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - creating new proxy for entity
2005-06-16 19:15:48,265 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - loading entity: [com.sa.go.bto.BusinessJumpPage#7157]
2005-06-16 19:15:48,265 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - entity found in session cache
2005-06-16 19:15:48,265 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - loading entity: [com.sa.go.bto.MarketingPromotion#172]
2005-06-16 19:15:48,265 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - creating new proxy for entity
2005-06-16 19:15:48,281 [Thread-10] DEBUG org.hibernate.engine.CollectionLoadContext - creating collection wrapper:[com.sa.go.bto.Business.categories#5728]
2005-06-16 19:15:48,296 [Thread-10] DEBUG org.hibernate.engine.CollectionLoadContext - creating collection wrapper:[com.sa.go.bto.Business.marketingPromotions#5728]
2005-06-16 19:15:48,296 [Thread-10] DEBUG org.hibernate.engine.CollectionLoadContext - creating collection wrapper:[com.sa.go.bto.Business.discounts#5728]
2005-06-16 19:15:48,296 [Thread-10] DEBUG org.hibernate.engine.CollectionLoadContext - creating collection wrapper:[com.sa.go.bto.Business.jumpPages#5728]
2005-06-16 19:15:48,296 [Thread-10] DEBUG org.hibernate.engine.CollectionLoadContext - creating collection wrapper:[com.sa.go.bto.Business.keywords#5728]
2005-06-16 19:15:48,296 [Thread-10] DEBUG org.hibernate.engine.CollectionLoadContext - creating collection wrapper:[com.sa.go.bto.Business.locations#5728]
2005-06-16 19:15:48,296 [Thread-10] DEBUG org.hibernate.engine.CollectionLoadContext - creating collection wrapper:[com.sa.go.bto.Business.promotions#5728]
2005-06-16 19:15:48,296 [Thread-10] DEBUG org.hibernate.engine.TwoPhaseLoad - done materializing entity [com.sa.go.bto.Business#5728]
2005-06-16 19:15:48,296 [Thread-10] DEBUG org.hibernate.engine.TwoPhaseLoad - resolving associations for [com.sa.go.bto.BusinessJumpPage#7157]
2005-06-16 19:15:48,296 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - loading entity: [com.sa.go.bto.Business#5728]
2005-06-16 19:15:48,296 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - entity found in session cache
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - loading entity: [com.sa.go.bto.Graphic#2989]
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - entity found in session cache
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - loading entity: [com.sa.go.bto.Graphic#3342]
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - entity found in session cache
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.engine.CollectionLoadContext - creating collection wrapper:[com.sa.go.bto.BusinessJumpPage.discounts#7157]
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.engine.TwoPhaseLoad - done materializing entity [com.sa.go.bto.BusinessJumpPage#7157]
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.engine.TwoPhaseLoad - resolving associations for [com.sa.go.bto.Graphic#3342]
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.engine.TwoPhaseLoad - done materializing entity [com.sa.go.bto.Graphic#3342]
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.engine.TwoPhaseLoad - resolving associations for [com.sa.go.bto.Graphic#2989]
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.engine.TwoPhaseLoad - done materializing entity [com.sa.go.bto.Graphic#2989]
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.engine.PersistenceContext - initializing non-lazy collections
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.event.def.DefaultInitializeCollectionEventListener - initializing collection [com.sa.go.bto.Business.discounts#5728]
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.event.def.DefaultInitializeCollectionEventListener - checking second-level cache
2005-06-16 19:15:48,312 [Thread-10] DEBUG org.hibernate.event.def.DefaultInitializeCollectionEventListener - collection not cached
2005-06-16 19:15:48,328 [Thread-10] DEBUG org.hibernate.loader.Loader - loading collection: [com.sa.go.bto.Business.discounts#5728]
2005-06-16 19:15:48,328 [Thread-10] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2005-06-16 19:15:48,328 [Thread-10] DEBUG org.hibernate.SQL - select discounts0_.BUSINESS_ID as BUSINESS10_1_, discounts0_.DISCOUNT_ID as DISCOUNT1_1_, discounts0_.DISCOUNT_ID as DISCOUNT1_0_, discounts0_.TITLE as TITLE14_0_, discounts0_.DESCRIPTION as DESCRIPT3_14_0_, discounts0_.LEGAL as LEGAL14_0_, discounts0_.DISCOUNT_CTA_TYPE_ID as DISCOUNT5_14_0_, discounts0_.CTA_TEXT as CTA6_14_0_, discounts0_.CTA_PARTNER_URL as CTA7_14_0_, discounts0_.CTA_FRAME_TEXT as CTA8_14_0_, discounts0_.GIFT_OFFER_ID as GIFT9_14_0_, discounts0_.BUSINESS_ID as BUSINESS10_14_0_, discounts0_.DISCOUNT_GRAPHIC_ID as DISCOUNT11_14_0_ from DISCOUNT discounts0_ where discounts0_.BUSINESS_ID=?
Hibernate: select discounts0_.BUSINESS_ID as BUSINESS10_1_, discounts0_.DISCOUNT_ID as DISCOUNT1_1_, discounts0_.DISCOUNT_ID as DISCOUNT1_0_, discounts0_.TITLE as TITLE14_0_, discounts0_.DESCRIPTION as DESCRIPT3_14_0_, discounts0_.LEGAL as LEGAL14_0_, discounts0_.DISCOUNT_CTA_TYPE_ID as DISCOUNT5_14_0_, discounts0_.CTA_TEXT as CTA6_14_0_, discounts0_.CTA_PARTNER_URL as CTA7_14_0_, discounts0_.CTA_FRAME_TEXT as CTA8_14_0_, discounts0_.GIFT_OFFER_ID as GIFT9_14_0_, discounts0_.BUSINESS_ID as BUSINESS10_14_0_, discounts0_.DISCOUNT_GRAPHIC_ID as DISCOUNT11_14_0_ from DISCOUNT discounts0_ where discounts0_.BUSINESS_ID=?
2005-06-16 19:15:48,328 [Thread-10] DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
2005-06-16 19:15:48,375 [Thread-10] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
2005-06-16 19:15:48,375 [Thread-10] DEBUG org.hibernate.loader.Loader - result set contains (possibly empty) collection: [com.sa.go.bto.Business.discounts#5728]
2005-06-16 19:15:48,375 [Thread-10] DEBUG org.hibernate.engine.CollectionLoadContext - uninitialized collection: initializing
2005-06-16 19:15:48,375 [Thread-10] DEBUG org.hibernate.loader.Loader - processing result set
2005-06-16 19:15:48,375 [Thread-10] DEBUG org.hibernate.loader.Loader - result set row: 0
2005-06-16 19:15:48,390 [Thread-10] DEBUG org.hibernate.loader.Loader - result row: EntityKey[com.sa.go.bto.Discount#1869]
2005-06-16 19:15:48,390 [Thread-10] DEBUG org.hibernate.loader.Loader - Initializing object from ResultSet: [com.sa.go.bto.Discount#1869]
2005-06-16 19:15:48,390 [Thread-10] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Hydrating entity: [com.sa.go.bto.Discount#1869]
2005-06-16 19:15:48,390 [Thread-10] DEBUG org.hibernate.loader.Loader - found row of collection: [com.sa.go.bto.Business.discounts#5728]
2005-06-16 19:15:48,390 [Thread-10] DEBUG org.hibernate.engine.CollectionLoadContext - reading row
2005-06-16 19:15:48,390 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - loading entity: [com.sa.go.bto.Discount#1869]
2005-06-16 19:15:48,390 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - attempting to resolve: [com.sa.go.bto.Discount#1869]
2005-06-16 19:15:48,390 [Thread-10] DEBUG org.hibernate.event.def.DefaultLoadEventListener - resolved object in session cache: [com.sa.go.bto.Discount#1869]
200