When I try to insert a object into the database, then NHibernate does the data binding as expected but the SQL command send to the database has unexpected type settings:
The Log trace from hibernate:
5688 [2112] DEBUG NHibernate.Type.StringType (null) - binding 'mr 1'NHibernateTestClient.exe': Loaded 'c:\projekte\tedradis\entwicklung\trunk\hauptprojekt\src\common\nhibernatetestclient\bin\debug\mono.security.dll', No symbols loaded.
' to parameter: 0
5868 [2112] DEBUG NHibernate.Type.Int32Type (null) - binding '1' to parameter: 1
5868 [2112] DEBUG NHibernate.Type.StringType (null) - binding 'modelrange 1' to parameter: 2
5868 [2112] DEBUG NHibernate.Type.StringType (null) - binding 'fb92f52c579c4369be0f56e1cb00ac45' to parameter: 3
5878 [2112] DEBUG NHibernate.SQL (null) - INSERT INTO modelrange (mr_name, mr_number, mr_comment, guid) VALUES (:p0, :p1, :p2, :p3)
5878 [2112] DEBUG NHibernate.Connection.DriverConnectionProvider (null) - Obtaining IDbConnection from Driver
7580 [2112] DEBUG NHibernate.Impl.BatcherImpl (null) - Closed IDbCommand, open IDbCommands :0
7590 [2112] DEBUG NHibernate.Util.ADOExceptionReporter (null) - could not insert: [DataEntity.ModelRange#fb92f52c579c4369be0f56e1cb00ac45]
Npgsql.NpgsqlException:
length for type varchar must be at least 1
Severity: ERROR
Code: 22023
The Database Log Trace shows:
2005-11-15 17:04:00 STATEMENT: INSERT INTO modelrange (mr_name, mr_number, mr_comment, guid) VALUES ('mr 1'::varchar(0), 1::int4, 'modelrange 1'::varchar(0), '4cb02594b82b438eb138a5acca1e32ea'::varchar(0))
The varchar(0) is incorrect. I have no idea to fix it. I already tried to set the length of the properties in the mapping configuration.
|