使用 Fluent NHibernate 映射大字符串
我正在使用 Oracle DB,并且正在尝试映射此类:
public class Book
{
public virtual int Id { get; private set; }
public virtual string Author { get; set; }
public virtual string Title { get; set; }
public virtual string Text { get; set; }
}
使用此映射类:
public class BookMap : ClassMap<Book>
{
public BookMap()
{
Id(x => x.Id);
Map(x => x.Author);
Map(x => x.Title);
Map(x => x.Text);
}
}
但它生成的列类型是 NVARCHAR(255),并且 Book.Text
属性的字符数远远超过 255 个。
如何将其映射到可以包含非常大字符串的类型(例如 CLOB)?
I'm working with an Oracle DB, and I'm trying to map this class:
public class Book
{
public virtual int Id { get; private set; }
public virtual string Author { get; set; }
public virtual string Title { get; set; }
public virtual string Text { get; set; }
}
With this mapping class:
public class BookMap : ClassMap<Book>
{
public BookMap()
{
Id(x => x.Id);
Map(x => x.Author);
Map(x => x.Title);
Map(x => x.Text);
}
}
But the column type that it generates me is NVARCHAR(255), And the Book.Text
Property has much more than 255 characters.
How can I map it to a type that can contain a very large string (for example CLOB)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
或者
or