-->
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: index
PostPosted: Fri Oct 21, 2005 10:19 am 
Hi all,

I start to use nhibernate on a big project.
Before we use our db layer which is not so good...
I use nhibernate.mapping.attributes.
so i have 2 problem that I can not solve:

- I try to index more than one collumn on a table and it bug because it seems that Id can be used only one time in a table (seems to be the primaykey)
but how set some index as on oracle db to increase the speed of request with statement whioch contain this index.
I have seen that there is [index] but do not succeed to use it.

- my other problem is that I use a class dbobject and all my persistent class inherit of it.

this dbobject class contain the primary key for all the DB which is name ObjectID in code but with name changed to tablename_ID in table.
but how get in the attributes the tablename which is contain in otehr attributes.
example to explain better:
Code:
public abstract class DataObject : ICloneable
   {

      public DataObject()
      {
         objectId = IdGenerator.generateId();//here is my generator of GUID
         dirty = false;
         valid = false;
      }

                [Id(0, Type="string")]//here is my problem i wsant to add Column=mytablename+"_ID"
         [Generator(1,Class="assigned")]
      [Browsable(false)]
      public string ObjectId
      {
         get
         {
            return objectId;
         }
         set
         {
            objectId = value;
         }
      }


Top
  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 10:21 am 
I forget another thing:
how to flush only one table (write not an object but the full table)


thanks by advance for all anwser


Top
  
 
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.