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;
}
}