- Home
- LLBLGen Pro
- Bugs & Issues
Errors With Access DB and nHibernate
Joined: 12-May-2015
Hello,
I'm coming from a LAMP background so apologies if this is a silly question.
I'm build a web application using .NET framework 4.5 and MVC.
I'm developing in Visual Studio 2013 Community on Windows
I need to connect to an access database (.mdb) and I'm using nHibernate to do so.
This is all working - I've connected to the database and have basic CRUD functionality for a smaller table.
I now want to model the entire database and have downloaded your product.
I'm having some issues.
The connection to the DB is fine - I can then reverse engineer the models and all looks good.
When I validate I get this message :
The mappings to meta-data of database 'MS Access' are not supported as NHibernate doesn't support this database natively
I'm not sure why I'm getting this as nHibernate does support MS Access - I'm using it because it does.
Even though I've got the error I can still generate code. When I do so I get this :
Source code generator process results Task execution log of tasks for group ''. Task execution started on: 13-May-2015 08:44.05 Task group: SD.NHibernate (Fluent NHibernate and classes). For database: MS Access (OleDb) (4F77DEE6-918E-4a53-8B3B-A076B00A3E0D). Task group: Generate NHibernate Domain model (SD.Tasks.Base.GenericTaskGroup). For database: MS Access (OleDb) (4F77DEE6-918E-4a53-8B3B-A076B00A3E0D). Task: Generate AssemblyInfo class (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateAssemblyInfo'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate Entity Classes (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateEntity'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate ValueType Classes (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateValueType'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate TypedView Classes (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateTypedViewRow'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate TypedList Classes (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateTypedListRow'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate VS.NET project file (SD.Tasks.Base.GenerateVSNetProject) Could not find template 'SD_NHibernateVsNet'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task group: Generate NHibernate database specific code and FluentNHibernate mapping code (SD.Tasks.Base.GenericTaskGroup). For database: MS Access (OleDb) (4F77DEE6-918E-4a53-8B3B-A076B00A3E0D). Task: Generate AssemblyInfo class (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateAssemblyInfo'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate Entity Mapping Files (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateEntityFluentMapping'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate TypedView Mapping Files (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateTypedViewFluentMapping'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate TypedListQueryFactory Class (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateTypedListQueryFactory'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate SessionManager Class (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateSessionManagerFluent'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate app.config file (SD.Tasks.Base.ConsumeLptTemplate) Could not find template 'SD_NHibernateAppConfig'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task: Generate VS.NET project file (SD.Tasks.Base.GenerateVSNetProject) Could not find template 'SD_NHibernatePersistenceVsNet'. It is not defined in the used templatebindings or is empty. It can be it's not defined for the current database (e.g. stored procedure templates for SqlServer CE) Task execution ended on: 13-May-2015 08:44.06
Target Language is C# Target platform is .NET 4.5 Selected preset is SD.NHibernate (Fluent code and classes).
Do you have any ideas where I'm going wrong?
Cheers,
Lee
We don't support nhibernate on msaccess as the dialect class of nhibernate for msaccess is rather limited. This means we don't ship msaccess specific templates for nhibernate. There's a 3rd party jet driver for nhibernate, but as it's a separate project we decided not to support it as we don't know the quality of it, or whether it's continued.
What's interesting though is indeed that you could proceed after the error, as code generation shouldn't proceed if there are errors. What version / build are you using?
Joined: 12-May-2015
Its 4.1 I think ( I downloaded it yesterday).
It doesn't look like I'll be able to use this to build my models then?
I need to connect to Access database so I can't use Entity Framework.
I've found 3 options;
direct connection using OLEDB - It looks like I'd need to build my own repository for interacting with database (which is what I'm used to in PHP / MySQL)
Using linqtoDB - this actually built my models for me but I'm not sure if linqtoDB is robust enough.
Fluent nHibernate - all connected up fine but I just wanted a tool to help me build the models, which is where I thought you'd come in.
I'm OK building these by hand as I think its a good learning experience.
Does it sound like I'm approaching this the right way?
Cheers,
Lee
LeeDenny87 wrote:
Its 4.1 I think ( I downloaded it yesterday).
4.2
It doesn't look like I'll be able to use this to build my models then?
Sure you can. Our own framework supports ms access without problems. It's included in the designer.
I need to connect to Access database so I can't use Entity Framework.
I've found 3 options;
direct connection using OLEDB - It looks like I'd need to build my own repository for interacting with database (which is what I'm used to in PHP / MySQL)
Using linqtoDB - this actually built my models for me but I'm not sure if linqtoDB is robust enough.
Fluent nHibernate - all connected up fine but I just wanted a tool to help me build the models, which is where I thought you'd come in.
I'm OK building these by hand as I think its a good learning experience.
Does it sound like I'm approaching this the right way?
switch the target framework in the project explorer to 'llblgen pro runtime framework', then generate code, choose 'Adapter'. You get code which is async aware (if you opt for .net 4.5) and comes with a linq provider. Works with access without problems. Would that work for you?