Diese Ausnahme:Infamous: Ungültige Index n für diese SqlParameterCollection mit Count =
Ungültiger Index n für diese SqlParameterCollection mit Count =
Normalerweise verweist auf doppelte Zuordnungsinformationen (siehe Stack-Überlauf + Google). Ich bin mir ziemlich sicher, dass ich keine habe. Gibt es andere Gründe dafür?
Ich habe das Problem identifiziert. Ich stellte dies vor:
[DocumentId]
public virtual int GI
{
get { return base.Id; }
protected set { base.Id = value; }
}
Um die Suche über lucene.net zu verwenden. Dies scheint FNH zu stören! Was sind meine Möglichkeiten hier?
PS:
at System.Data.SqlClient.SqlParameterCollection.RangeCheck(Int32 index)
at System.Data.SqlClient.SqlParameterCollection.GetParameter(Int32 index)
at System.Data.Common.DbParameterCollection.System.Collections.IList.get_Item(Int32 index)
at NHibernate.Type.Int32Type.Set(IDbCommand rs, Object value, Int32 index)
at NHibernate.Type.NullableType.NullSafeSet(IDbCommand cmd, Object value, Int32 index)
at NHibernate.Type.NullableType.NullSafeSet(IDbCommand st, Object value, Int32 index, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Dehydrate(Object id, Object[] fields, Object rowId, Boolean[] includeProperty, Boolean[][] includeColumns, Int32 table, IDbCommand statement, ISessionImplementor session, Int32 index)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Boolean[] notNull, Int32 j, SqlCommandInfo sql, Object obj, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object id, Object[] fields, Object obj, ISessionImplementor session)
at NHibernate.Action.EntityInsertAction.Execute()
at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
at NHibernate.Engine.ActionQueue.ExecuteActions()
at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()
at SharpArch.Data.NHibernate.DbContext.CommitChanges()
at Updater1.Program.Main(String[] args) in C:\Users\bla\Documents\Visual Studio 2010\Projects\Bla\Updater1\Program.cs:line 97
PPS:
public class MappedSequenceMap : IAutoMappingOverride<MappedSequence>
{
public void Override(AutoMapping<MappedSequence> mapping)
{
mapping.Id(x => x.Id, "GI").GeneratedBy.Assigned();
mapping.Map(x => x.Affiliation).Length(10000);
mapping.Map(x => x.Gene).Length(10000);
mapping.Map(x => x.OriginalIsolationCountry).Length(10000);
mapping.Map(x => x.OriginalAffiliation).Length(10000);
mapping.Map(x => x.PMIDs).Length(10000);
mapping.Map(x => x.Product).Length(10000);
mapping.Map(x => x.Fasta).Length(10000);
mapping.Map(x => x.Note).Length(10000);
mapping.Map(x => x.Strain).Length(10000);
mapping.HasManyToMany(x => x.PubmedPublications).Table("SequencesPubmedPublications");
}
}
Ich sagte, dass ich SO gegoogelt und gesucht habe (siehe Frage) !!!Es gibt keine HQL, da es sich um eine einfache Save() einer Entität über ein s # arp-Repository handelt. – cs0815
Ich würde die vollständige Ausnahme (exception.ToString()) erneut posten und die relevante Zuordnung nur zur Sicherheit veröffentlichen. –
Brauchen Sie die vollständige Zuordnung für die betreffende Entität zu sehen – Rippo