These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: SingleTableEntityPersister.GetPropertyTableName() exception
PostPosted: Thu Jul 26, 2007 9:50 am 
Beginner
Beginner

Joined: Thu May 31, 2007 1:19 pm
Posts: 23
Hi

Not sure if this is the place to mention this (if possible, can someone tell me where to do so?)

I need to examine my meta data in my Interceptor in order to update some external data, and for this, I need to determine the underlying table that a property is being written to.

I am getting an IClassMetaData from my SessionFactory in the OnFlushDirty, and am casting this to an AbstractEntityPersister.

I am then hoping to be able to iterate through the persister's propertynames, calling "GetPropertyTableName" for each property.

Unfortunately, this is attempting to return tableNames[0], and tableNames is null.

It is worth mentioning that I am using the most recent source from SVN because I need to make use of the "Join" attribute (i.e. different properties in my object are persisted to different tables)

Mark.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 26, 2007 11:24 am 
Beginner
Beginner

Joined: Thu May 31, 2007 1:19 pm
Posts: 23
This is the code:

Code:
      public override string GetPropertyTableName(string propertyName)
      {
         return tableNames[0];
      }


I believe this is a fix for the problem:

Code:
      public override string GetPropertyTableName(string propertyName)
      {
         //return tableNames[0];
            int propertyIndex = GetPropertyIndex(propertyName);
            int propertyTableNumber = PropertyTableNumbers[propertyIndex];
            string tableName = GetTableName(propertyTableNumber);
            return tableName;
      }


Is it possible to submit this somewhere?

Thanks,
Mark.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.