typedef convention
Sorry I am a little lost with this. I have a class Email which I would like to see mapped as a string in the database with a specific length. Is there a simple way to set up this convention?
2 people watching.
-
New Issue
-
Conversation Started
The Fluent NHibernate staff has started a conversation to resolve this discussion.
-
Close the discussion Close the discussion
Private Permissions
This discussion is private. Only you and Fluent NHibernate support staff can see and reply to it.
Recent Discussions
09 Dec, 2010 09:42 AM | Property formula is not working. | |
08 Dec, 2010 05:24 PM | Setting length on composite -key property | |
02 Dec, 2010 09:33 PM | Setting Component as Unique Key | |
02 Dec, 2010 07:29 PM | Conventions for ICompositeUserTypes and field overrides | |
26 Nov, 2010 01:24 PM | Maping details collection using interface for detail |
22 Nov, 2010 09:59 PM | Mapping a view without a unique id column | |
22 Nov, 2010 09:27 PM | <many-to-one> and access setting | |
18 Nov, 2010 03:32 PM | Control the name of the Primary Key and Unique Constraint Names | |
18 Nov, 2010 03:00 PM | ForeignKeyConstraintName for References | |
14 Nov, 2010 12:40 PM | SQLite Versioning Configuration Question |
Support Staff 2 Posted by Paul Batum on 17 May, 2010 04:49 AM
Can you give us a bit more info, such as what your domain model and schema look like? Your description isn't quite specific enough.
Also, the conventions page on the wiki might help:
wiki.fluentnhibernate.org/conventions
3 Posted by Aaron Fischer on 17 May, 2010 04:42 PM
class contact : BaseEntity
{ [StringLength(50)] public virtual String Name{ get;set;}
public virtual Email Email{ get:set;}
}
public partial class Email
contact would map to
contacts table with a varchar(50) Name column along with a varchar(255) email column.
Support Staff 4 Posted by Paul Batum on 18 May, 2010 12:00 PM
Okay you have two major options I think.
1. Make email a component.
2. Make email an IUserType
Google and the nhibernate documentation will tell you more about the two options.
I would probably try a component first.
http://wiki.fluentnhibernate.org/Fluent_mapping#Components