0
Nperiberence apiとエンティティフレームワークでNhibernateを使用しています。私が見つけたのチュートリアルのほとんどでメモリ内のSQLiteが動作しません。テーブルが見つかりませんでしたエラー
using System;
using NPersistence;
namespace CSharp
{
[Entity]
[Table(Name = "edge")]
public class Edge
{
[Id]
[GeneratedValue]
public virtual int edgeId { get; set;}
public virtual int fromnode{ get; set; }
public virtual int tonode { get; set;}
public virtual string edgelabel{ get; set;}
public Edge(){
}
}
}
、は、connection_string =設定:メモリを:動作するはずです以下は、私のpersistence.xml
<provider>NPersistence.NHibernate.NHibernatePersistence</provider>
<class>CSharp.Node </class>
<class>CSharp.Edge</class>
<properties>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SQLite20Driver</property>
<property name="connection.connection_string">Data Source=:memory:</property>
<property name="dialect">NHibernate.Dialect.SQLiteDialect</property>
<property name="connection.release_mode"> on_close </property>
<property name="query.substitutions">true=1;false=0</property>
<property name="hbm2ddl.auto" value="update"/>
</properties>
マイノードクラスです。しかし、私はまた、あなたのデータベースをSchemaExportのために必要な以下のエラーに
NPersistence.PersistenceException: could not execute query
no such table: edge
スキーマをエクスポートするにはどうすればよいですか?私はこれに新しいです。以前はSqlite(ファイルベース)とmyql dbを使用していましたが、dbを明示的にエクスポートしませんでした。私はコードを変更せずにpersistence.xmlファイルを変更しました –