Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.2.0.cr2
Mapping documents:
<?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 package="net.iss.rssp.entity" >
<class name="SensorInfo" table="Component" lazy="false">
<id name="componentId" column="ComponentID">
<generator class="native"/>
</id>
<property name="version" column="Version"/>
<property name="modelDescription" column="ModelDesc"/>
<property name="installedXPU" column="LastInstalledXPU"/>
<property name="availableXpu" column="AvailableXPU"/>
<property name="policy" column="Policy"/>
<property name="response" column="Response"/>
<property name="stateDescription" column="StateDescription"/>
<property name="status" column="Status"/>
<property name="eventCollectorCompId" column="EventCollectorID"/>
<property name="lastPushedPolicyId" column="lastPushedPolicyID"/>
<property name="lastResponseId" column="lastPushedResponseID"/>
<property name="propertyId" column="PropertyFileID"/>
<property name="lastHeartbeat" column="LastHeartBeat"/>
<property name="loggingLevel" column="LoggingLevel"/>
<property name="eventCollectorStatus" column="ECStatus"/>
<property name="optionFlag" column="OptionFlags"/>
<property name="xpuStateDescription" column="XPUStateDescription"/>
<property name="xpuStatus" column="XPUState"/>
<property name="sensorName" column="SensorName"/>
<property name="sensorGuid" column="GUID"/>
<set name="documentInstances">
<key column="ComponentID"/>
<one-to-many entity-name="ComponentDocument"/>
</set>
</class>
<class name="Group" table="Groups" lazy="false">
<id name="id" column="GroupID">
<generator class="native"/>
</id>
<property name="name" column="GroupName"/>
<property name="description" column="GroupDesc"/>
<property name="parentId" column="ParentGroupID"/>
<property name="groupType" column="GroupTypeID"/>
<property name="viewId" column="GroupViewID"/>
<property name="aclId" column="ACLID"/>
<property name="InheritedACL" column="inheritedACL"/>
<property name="deleted" column="Deleted"/>
<set name="documentInstances">
<key column="GroupID"/>
<one-to-many entity-name="GroupDocument"/>
</set>
</class>
<class name="UntypedDocumentInstance" table="GroupDocument" entity-name="GroupDocument" lazy="false">
<id name="id" column="GroupDocumentID">
<generator class="native"/>
</id>
<property name="enabled" column="enabled"/>
<property name="schemaVersion" column="version"/>
<property name="guid" column="guid" not-null="true"/>
<many-to-one name="namespace" column="NamespaceID" not-null="true" cascade="all" outer-join="true"/>
<many-to-one name="workspace" column="WorkspaceID" not-null="true" outer-join="true"/>
<many-to-one name="source" column="OriginalWorkspaceID" outer-join="true"/>
<many-to-one name="binaryData" column="BinaryDataID" unique="true" not-null="true" cascade="all" outer-join="true"/>
<many-to-one name="owner" column="GroupID" class="Group" not-null="true"/>
</class>
<class name="UntypedDocumentInstance" table="ComponentDocument" entity-name="ComponentDocument" lazy="false">
<id name="id" column="ComponentDocumentID">
<generator class="native"/>
</id>
<property name="enabled" column="enabled"/>
<property name="schemaVersion" column="version"/>
<many-to-one name="namespace" column="NamespaceID" not-null="true" cascade="all" outer-join="true"/>
<many-to-one name="workspace" column="WorkspaceID" not-null="true" outer-join="true"/>
<many-to-one name="source" column="OriginalWorkspaceID" outer-join="true"/>
<many-to-one name="binaryData" column="BinaryDataID" unique="true" not-null="true" cascade="all" outer-join="true"/>
<many-to-one name="owner" column="ComponentID" class="SensorInfo" not-null="true"/>
</class>
<class name="Workspace" table="DocumentWorkspace" lazy="false">
<id name="id" column="WorkspaceID">
<generator class="native"/>
</id>
<property name="name" column="WorkspaceName" access="field" />
<property name="description" column="WorkspaceDescription" access="field"/>
<property name="production" column="IsLiveWorkspace"/>
<property name="lastModifiedAt" type="net.iss.rssp.utils.GMTDateType"/>
<many-to-one name="lastModifiedBy" column="LastModifiedByPrincipalID" outer-join="true"/>
<set name="groupDocumentInstances" lazy="true" inverse="true">
<key column="WorkspaceID"/>
<one-to-many entity-name="GroupDocument"/>
</set>
<set name="agentDocumentInstances" lazy="true" inverse="true">
<key column="WorkspaceID"/>
<one-to-many entity-name="ComponentDocument"/>
</set>
</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>
<query name="Grant.findByPermission">from GrantValue as p where p.permissionTarget.name=? and p.permissionAction.name=?</query>
<query name="ACL.clearOwner">update AclValue as acl set acl.owner = null where acl.owner=?</query>
<query name="SchemaNamespace.getNamespace">from SchemaNamespace as ns where ns.namespace = ?</query>
<query name="Workspace.deleteGroupSources">update GroupDocument as gd set gd.source=null where gd.source=?</query>
<query name="Workspace.deleteAgentSources">update ComponentDocument as cd set cd.source=null where cd.source=?</query>
<query name="GroupDocument.delete.sources.binarydata">update GroupDocument as gd set gd.source=null where gd.source=:source and gd.namespace=:namespace and gd.owner=:owner and gd.schemaVersion=:version</query>
<query name="ComponentDocument.delete.sources.binarydata">update ComponentDocument as cd set cd.source=null where cd.source=:source and cd.namespace=:namespace and cd.owner=:owner and cd.schemaVersion=:version</query>
<query name="DocumentInstances.loadGroupDocument">
select bd from Group as g
join g.documentInstances as di
join di.binaryData as bd
where
g.id = :id
and di.namespace.namespace = :namespace
and di.schemaVersion = :schemaVersion
and di.guid = :guid
and di.workspace = :workspace
and bd.binaryDataId = di.binaryData.binaryDataId
</query>
<query name="DocumentInstances.loadGroupDocument.enabled">
select bd from Group as g
join g.documentInstances as di
join di.binaryData as bd
where
g.id = :id
and di.enabled = true
and di.namespace.namespace = :namespace
and di.schemaVersion = :schemaVersion
and di.guid = :guid
and di.workspace = :workspace
and bd.binaryDataId = di.binaryData.binaryDataId
</query>
<query name="DocumentInstances.loadComponentDocument">
select bd from SensorInfo as c
join c.documentInstances as di
join di.binaryData as bd
where
c.id = :id
and di.namespace.namespace = :namespace
and di.schemaVersion = :schemaVersion
and di.workspace = :workspace
and bd.binaryDataId = di.binaryData.binaryDataId
</query>
<query name="DocumentInstances.loadComponentDocument.enabled">
select bd from SensorInfo as c
join c.documentInstances as di
join di.binaryData as bd
where
c.id = :id
and di.enabled = true
and di.namespace.namespace = :namespace
and di.schemaVersion = :schemaVersion
and di.workspace = :workspace
and bd.binaryDataId = di.binaryData.binaryDataId
</query>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
SQL server 2000
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
[java] DEBUG: Checking named query: ACL.clearOwner
[java] DEBUG: unable to locate HQL query plan in cache; generating (update AclValue as acl set acl.owner = null where acl.owner=?)
[java] DEBUG: parse() - HQL: update net.iss.rssp.security.acl.AclValue as acl set acl.owner = null where acl.owner=?
[java] DEBUG: --- HQL AST ---
[java] \-[UPDATE] 'update'
[java] +-[FROM] 'FROM'
[java] | \-[RANGE] 'RANGE'
[java] | +-[DOT] '.'
[java] | | +-[DOT] '.'
[java] | | | +-[DOT] '.'
[java] | | | | +-[DOT] '.'
[java] | | | | | +-[DOT] '.'
[java] | | | | | | +-[IDENT] 'net'
[java] | | | | | | \-[IDENT] 'iss'
[java] | | | | | \-[IDENT] 'rssp'
[java] | | | | \-[IDENT] 'security'
[java] | | | \-[IDENT] 'acl'
[java] | | \-[IDENT] 'AclValue'
[java] | \-[ALIAS] 'acl'
[java] +-[SET] 'set'
[java] | \-[EQ] '='
[java] | +-[DOT] '.'
[java] | | +-[IDENT] 'acl'
[java] | | \-[IDENT] 'owner'
[java] | \-[NULL] 'null'
[java] \-[WHERE] 'where'
[java] \-[EQ] '='
[java] +-[DOT] '.'
[java] | +-[IDENT] 'acl'
[java] | \-[IDENT] 'owner'
[java] \-[PARAM] '?'
[java] DEBUG: throwQueryException() : no errors
[java] DEBUG: update << begin [level=1, statement=update]
[java] DEBUG: FromClause{level=1} : net.iss.rssp.security.acl.AclValue (acl) -> aclvalue0_
[java] DEBUG: Resolved : acl -> ACLID
[java] DEBUG: getDataType() : owner -> org.hibernate.type.ManyToOneType(net.iss.rssp.security.principal.DbPrincipal)
[java] DEBUG: dereferenceShortcut() : property owner in net.iss.rssp.security.acl.AclValue does not require a join.
[java] WARN: Using non-qualified column reference [owner -> ([OwnerPrincipalID])]
[java] DEBUG: Resolved : acl.owner -> OwnerPrincipalID
[java] DEBUG: Resolved : acl -> ACLID
[java] DEBUG: getDataType() : owner -> org.hibernate.type.ManyToOneType(net.iss.rssp.security.principal.DbPrincipal)
[java] DEBUG: dereferenceShortcut() : property owner in net.iss.rssp.security.acl.AclValue does not require a join.
[java] WARN: Using non-qualified column reference [owner -> ([OwnerPrincipalID])]
[java] DEBUG: Resolved : acl.owner -> OwnerPrincipalID
[java] DEBUG: update : finishing up [level=1, statement=update]
[java] DEBUG: update >> end [level=1, statement=update]
[java] DEBUG: --- SQL AST ---
[java] \-[UPDATE] UpdateStatement: 'update' querySpaces (ACL)
[java] +-[FROM] FromClause: 'FROM' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[acl], fromElementByTableAlias=[aclvalue0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
[java] | \-[FROM_FRAGMENT] FromElement: 'ACL' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=acl,role=null,tableName=ACL,tableAlias=aclvalue0_,origin=null,colums={,className=net.iss.rssp.security.acl.AclValue}}
[java] +-[SET] SqlNode: 'set'
[java] | \-[EQ] BinaryLogicOperatorNode: '='
[java] | +-[DOT] DotNode: 'OwnerPrincipalID' {propertyName=owner,dereferenceType=ROOT_LEVEL,propertyPath=owner,path=acl.owner,tableAlias=aclvalue0_,className=net.iss.rssp.security.acl.AclValue,classAlias=acl}
[java] | | +-[ALIAS_REF] IdentNode: 'ACLID' {alias=acl, className=net.iss.rssp.security.acl.AclValue, tableAlias=aclvalue0_}
[java] | | \-[IDENT] IdentNode: 'owner' {originalText=owner}
[java] | \-[NULL] SqlNode: 'null'
[java] \-[WHERE] SqlNode: 'where'
[java] \-[EQ] BinaryLogicOperatorNode: '='
[java] +-[DOT] DotNode: 'OwnerPrincipalID' {propertyName=owner,dereferenceType=ROOT_LEVEL,propertyPath=owner,path=acl.owner,tableAlias=aclvalue0_,className=net.iss.rssp.security.acl.AclValue,classAlias=acl}
[java] | +-[ALIAS_REF] IdentNode: 'ACLID' {alias=acl, className=net.iss.rssp.security.acl.AclValue, tableAlias=aclvalue0_}
[java] | \-[IDENT] IdentNode: 'owner' {originalText=owner}
[java] \-[PARAM] ParameterNode: '?' {ordinal=0, expectedType=org.hibernate.type.ManyToOneType(net.iss.rssp.security.principal.DbPrincipal)}
[java] DEBUG: throwQueryException() : no errors
[java] DEBUG: throwQueryException() : no errors
[java] DEBUG: HQL param location recognition took 0 mills (update AclValue as acl set acl.owner = null where acl.owner=?)
=============================================
We are seeing a number of debug warnings from Hibernate all in the form:
Code:
Using non-qualified column reference [owner -> ([OwnerPrincipalID])]
(full log entry sample and mapping doc provided above) and cannot determine the cause of the warnings. If anyone can help decipher the meaning of these warnings, it would be greatly appreciated.
Thanks,
Yoel Spotts