I am using oracle as db and fluent Nhibernate for mapping.
Below is my Object Class
public class UserFieldEvent
{
public virtual int Id { get; set; }
public virtual UserFieldBase UserField { get; set; }
public virtual EventType EventType { get; set; }
public virtual string EventScript { get; set; }
}
The length of property EventScript can be from 0 to 4000.
In the database I made the column type for EventScript a CLOB.
Below is my mapping Class:
public UserFieldEventMap()
{
Table("TBLDS_USERFIELDEVENT");
Id(x => x.Id).GeneratedBy.Sequence("SEQDS_USERFIELDEVENT");
Map(x => x.EventType).CustomType<EventType>();
Map(x => x.EventScript).CustomSqlType("CLOB");
References(x => x.UserField).Column("USERFIELDBASEID");
}
Now whenever the length of EventScript is greater than 2000 I get the error "ORA-01461: can bind a LONG value only for insert into a LONG column ." while saving the object into database. Can anyone help on this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…