Currently we use v3.1 and I am working on to upgrade our solution to v4.2. To test the new features I created a new project with just one table and generated code with .NET 4.5, Self-Servicing, Template - SD.TemplateBindings.SharedTemplates, Task - SD.Presets.SelfServicing.TwoClasses.
My tables doesnt have any sequences tied to the PK column. Created entity by passing the pk in constructor and I see llblgen generates the select statement to retreview the data. But when i call save all the pk fields are not added to the insert statement and i get null error from oracle.
Here is the code
UiBamAuditEntity bamaudit = new UiBamAuditEntity(0, "TEST",20,2014);
bamaudit.MdfctnDt = DateTime.Now;
bamaudit.Save();
Oracle error because of missing pk fields in insert statement
{"ORA-01400: cannot insert NULL into (\"UFACTS\".\"UI_BAM_AUDIT\".\"YEAR_NU\")"}
Here is the insert statement
Query: INSERT INTO "UFACTS"."UI_BAM_AUDIT" ("MDFCTN_DT") VALUES (:p1)
Parameter: :p1 : Date. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 8/2/2014 4:10:30 PM.
at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Query\ActionQuery.cs:line 234
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteActionQuery(IActionQuery queryToExecute, ITransaction containingTransaction) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\DaoBase.cs:line 1490
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.AddNew(IEntityFields fields, ITransaction containingTransaction) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\DaoBase.cs:line 167
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.InsertEntity() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\EntityBase.cs:line 1097
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PersistQueue(List`1 queueToPersist, Boolean insertActions, ITransaction transactionToUse) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\DaoBase.cs:line 1939
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.Save(IPredicate updateRestriction, Boolean recurse) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\EntityBase.cs:line 697
at SD.LLBLGen.Pro.ORMSupportClasses.EntityBase.Save() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.2\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\SelfServicingSpecific\EntityBase.cs:line 582
at UnitTestProject1.UnitTest1.TestMethod1() in c:\UIA\ShortCycleDev\BusinessEntities\UnitTestProject1\UnitTest1.cs:line 39