I am using Envers for auditing some of my DB Tables. Auditing is woking 
fine, I can see the data in the DB in the corresponding tables with my 
custom prefix etc. I can't query any data becouse I am getting always the 
following QueryException:

could not resolve property: originalId of: NaturalPerson [select e__, r__ 
from NaturalPerson e__, ExtendedRevisionEntity r__ where 
e__.originalId.RevisionID.id = r__.id order by e__.originalId.RevisionID.id 
asc]

This is the query code:

AuditReaderFactory.Get(session).CreateQuery().ForHistoryOf<NaturalPerson, 
ExtendedRevisionEntity>().Results();


Mappings for NaturalPerson


<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping assembly="Domain" namespace="Domain" xmlns=
"urn:nhibernate-mapping-2.2">
  <joined-subclass name="NaturalPerson"  schema="MySchema" table=
"NaturalPersons">
    <key column="PersonID" />
    <property name="Name" type="AnsiString"/>
  </joined-subclass>
</hibernate-mapping>

Envers config using fluent:

configuration.SetEnversProperty(ConfigurationKey.AuditTableSuffix, " ");
configuration.SetEnversProperty(ConfigurationKey.DefaultSchema, "aud"); 
configuration.SetEnversProperty(ConfigurationKey.StoreDataAtDelete, true);
configuration.SetEnversProperty(ConfigurationKey.RevisionFieldName, 
"RevisionID");
configuration.SetEnversProperty(ConfigurationKey.RevisionTypeFieldName, 
"RevisionTypeID");
enversConf.Audit<NaturalPerson>();

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to