[nhusers] Re: DB comments and description in NHibernate

2009-03-26 Thread Ken Egozi
afaik, Description is not available on all main RDBMS, thus NH is not
supporting it.



On Thu, Mar 26, 2009 at 11:47 AM, Utopico jardar.maa...@gmail.com wrote:


 I am working on a project where the database should be documented. I
 am looking for a way to use hibernate to define this in hibernate. I
 am using attributes on my classes to define my database (an example
 can be seen below).

[NHibernate.Mapping.Attributes.Class(Table = LINK)]
public partial class Link
private Int32 _id;
[NHibernate.Mapping.Attributes.Id(Name = Id, Column = ID)]
[NHibernate.Mapping.Attributes.Generator(1, Class =
 sequence)]
[NHibernate.Mapping.Attributes.Param(2, Name = sequence,
 Content = LINK_ID_SEQ)]
public virtual Int32 Id
{
get
{
return this._id;
}
set
{
this._id = value;
}
}
   }
 ...
 }


 What I am looking for is something like:

[NHibernate.Mapping.Attributes.Class(Table = LINK,
 Description=This is a table that keeps track of my links)]
public partial class Link

 and

[NHibernate.Mapping.Attributes.Param(2, Name = sequence,
 Content = LINK_ID_SEQ, Description=This is my primary key
 automatically generated by sequence number.)]
public virtual Int32 Id


 



-- 
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.gotfriends.co.il

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
nhusers group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~--~~~~--~~--~--~---



[nhusers] Re: DB comments and description in NHibernate

2009-03-26 Thread Dario Quintana
Should be something like this in hbm-language

To a table:
class name=Customer
comment my customer comment here/comment
...
/class

To a column:
property name=Name
column name=Name
commentMy Name comment here /comment
/column
/property

You should extrapolate this to those attributes, since are generated by the
NH-schema, should be supported.

The dialects with the option enabled are Oracle8iDialect on forward.
On Thu, Mar 26, 2009 at 6:47 AM, Utopico jardar.maa...@gmail.com wrote:


 I am working on a project where the database should be documented. I
 am looking for a way to use hibernate to define this in hibernate. I
 am using attributes on my classes to define my database (an example
 can be seen below).

[NHibernate.Mapping.Attributes.Class(Table = LINK)]
public partial class Link
private Int32 _id;
[NHibernate.Mapping.Attributes.Id(Name = Id, Column = ID)]
[NHibernate.Mapping.Attributes.Generator(1, Class =
 sequence)]
[NHibernate.Mapping.Attributes.Param(2, Name = sequence,
 Content = LINK_ID_SEQ)]
public virtual Int32 Id
{
get
{
return this._id;
}
set
{
this._id = value;
}
}
   }
 ...
 }


 What I am looking for is something like:

[NHibernate.Mapping.Attributes.Class(Table = LINK,
 Description=This is a table that keeps track of my links)]
public partial class Link

 and

[NHibernate.Mapping.Attributes.Param(2, Name = sequence,
 Content = LINK_ID_SEQ, Description=This is my primary key
 automatically generated by sequence number.)]
public virtual Int32 Id


 




-- 
Dario Quintana
http://darioquintana.com.ar

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
nhusers group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~--~~~~--~~--~--~---



[nhusers] Re: DB comments and description in NHibernate

2009-03-26 Thread Utopico

So it is a feature in the hbm-languague definition but not as
attributes? If so is it possible to add this feature to the attributes
in an easy way?

On 26 Mar, 13:09, Dario Quintana conta...@darioquintana.com.ar
wrote:
 Should be something like this in hbm-language

 To a table:
 class name=Customer
     comment my customer comment here/comment
     ...
 /class

 To a column:
 property name=Name
     column name=Name
         commentMy Name comment here /comment
     /column
 /property

 You should extrapolate this to those attributes, since are generated by the
 NH-schema, should be supported.

 The dialects with the option enabled are Oracle8iDialect on forward.



 On Thu, Mar 26, 2009 at 6:47 AM, Utopico jardar.maa...@gmail.com wrote:

  I am working on a project where the database should be documented. I
  am looking for a way to use hibernate to define this in hibernate. I
  am using attributes on my classes to define my database (an example
  can be seen below).

     [NHibernate.Mapping.Attributes.Class(Table = LINK)]
     public partial class Link
         private Int32 _id;
         [NHibernate.Mapping.Attributes.Id(Name = Id, Column = ID)]
         [NHibernate.Mapping.Attributes.Generator(1, Class =
  sequence)]
         [NHibernate.Mapping.Attributes.Param(2, Name = sequence,
  Content = LINK_ID_SEQ)]
         public virtual Int32 Id
         {
             get
             {
                 return this._id;
             }
             set
             {
                 this._id = value;
             }
         }
    }
  ...
  }

  What I am looking for is something like:

     [NHibernate.Mapping.Attributes.Class(Table = LINK,
  Description=This is a table that keeps track of my links)]
     public partial class Link

  and

         [NHibernate.Mapping.Attributes.Param(2, Name = sequence,
  Content = LINK_ID_SEQ, Description=This is my primary key
  automatically generated by sequence number.)]
         public virtual Int32 Id

 --
 Dario Quintanahttp://darioquintana.com.ar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
nhusers group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~--~~~~--~~--~--~---



[nhusers] Re: DB comments and description in NHibernate

2009-03-26 Thread Dario Quintana
I didn't say that.Since NHMA use the mapping schema to generate the
attributes, the option should be there.
Maybe after the definition maybe your class will be having more metadata
than code.

On Thu, Mar 26, 2009 at 10:21 AM, Utopico jardar.maa...@gmail.com wrote:


 So it is a feature in the hbm-languague definition but not as
 attributes? If so is it possible to add this feature to the attributes
 in an easy way?



-- 
Dario Quintana
http://darioquintana.com.ar

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
nhusers group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~--~~~~--~~--~--~---