1 / 83

Generator

Generator. All information's of PLINQO in this Document, I got it from:. http://www.codesmithtools.com/plinqo. So, you could visit the link above to research. 1. Introduce CodeSmith generator - PLINQO. 2. 3. 4. What is PLINQO for NHibernate ?. Key features PLINQO for Nhibernate .

felix
Download Presentation

Generator

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Generator

  2. All information's of PLINQO in this Document, I got it from: http://www.codesmithtools.com/plinqo So, you could visit the link above to research

  3. 1 Introduce CodeSmith generator - PLINQO 2 3 4 What is PLINQO for NHibernate? Key features PLINQO for Nhibernate. Getting Started Steps PLINQO for Nhibernate.

  4. 1 Introduce CodeSmith generator - PLINQO PLINQO is an enhanced alternative for the most popular Object Relational Mapping frameworks. It is a set of CodeSmith Templates designed to simplify the creation and maintenance of data models, as well as provide you with an easy to use data access layer that adhears to best practices.

  5. Microsoft's minimalist approach to ORMs, LINQ to SQL is the original lightweight LINQ implementation for data access.

  6. Entity Framework is Microsoft's ORM of choice. It is an advanced framework that uses multiple models to allow for flexibility.

  7. NHibernate is the open source community's ORM of choice. It is a port of Hibernate for Java that has taken on a life of it's own.

  8. Instant Data Layer Generation Safe Regeneration and Synchronization Open Source 1.1 1.3 1.2 Key Features:

  9. Instant Data Layer Generation 1.1 PLINQO will generate all of your database mappings, business entities, and query extensions instantly. Each generated class is separated into editable and generated files, all of which are organized into an intelligible folder structure.

  10. Safe Regeneration and Synchronization 1.2 Quickly and safely regenerate your data layer against your database. PLINQO intelligently seeks out and merges data changes with code changes, allowing you customize your ORM mappings and safely regenerate them!

  11. Open Source 1.3 All PLINQO templates and libraries are open source. This puts you in complete control of your source code, and allows you to customize your data layer to fit your needs. Interested in sharing your changes? Submit a patch and get it put into the next build of PLINQO

  12. 2 What is PLINQO for NHibernate? • PLINQO NH is a Replace and Enhance alternative to NHibernate. • PLINQO NH is available in C#, and supports SQL Server, Oracle, DB2, MySQL, and more!

  13. 2 What is PLINQO for NHibernate? PLINQO is a set of CodeSmith Templates that generate ORM (Object Relational Mapping) frameworks using consistent design patterns and best practices. PLINQO Frameworks also include an advanced set of features to both simplify and optimize the task of data access.

  14. 2 What is PLINQO for NHibernate? Advantaged: - simplifications - optimizations - convenience The ultimate goal is to take the best of both worlds and put them together into a robust framework that is easy to use. Without write CRUD (Create, Retrieve, Update, Delete) Method

  15. 3 Key features PLINQO for Nhibernate. PLINQO can generated your HBM files, entity classes, and all NHibernate configuration in seconds. It then allows you to safely regenerate that code at anytime, thus synchronizing your mappings with the database while still intelligently preserving custom changes.

  16. 3.1 3.2 3.3 3.4 3 Key features PLINQO for Nhibernate. Data Layer Generation Safe Regeneration Intuitive File Structure Query Logic

  17. 3.1 Data Layer Generation • Generate your HBM files from your database. • Supports Tables, Views, and Stored Procedures. • Supports associations and composite keys. • Generate your Entities from your HBM files.

  18. 3.2 Safe Regeneration • Safely regenerate your data layer against your database. • Intelligently seeks out and merges data changes with code changes. • Ability to filter what gets updated from the database.

  19. 3.3 Intuitive File Structure • Each generated class is separated into editable and generated files. • Complex types are generated into an organized folder structure.

  20. 3.4 Query Logic • Generates chainable query extension methods that simplify query logic. • Query extensions support advanced comparison and containment operators.

  21. 4.1 4.3 4.2 4 Getting Started Steps PLINQO for Nhibernate. How to install CodeSmith Generation Quick Start Manual Configuration

  22. 4.1 How to install CodeSmith Generation Download latest: http://code.google.com/p/codesmith/downloads/list?can=3&q=nhibernate Getting Started: http://docs.codesmithtools.com/display/NHibernate/Getting+Started Documentation: http://docs.codesmithtools.com/display/NHibernate/Home Additional download and samples: http://docs.codesmithtools.com/display/NHibernate/Downloads

  23. 4.1 How to install CodeSmith Generation • These templates are dependent on the following: • Development Applications: • CodeSmith Generator Professional 5.x • Microsoft Visual Studio 2010 • Runtime Assemblies: • .NET 4.0 • NHibernate 3.2.0.GA

  24. I downloaded and installed CodeSmith Generator 6.0

  25. In the Start menu & Desktop Icon

  26. In the Generator Menu or in the Add New Item dialog

  27. 4.2 Quick Start Open QuickStart.cst Select a SourceDatabase. Click Generate! See details in the next slide

  28. Double click on the CodeSmith Generator Explorer Icon  see the Code Smith Generator Explorer dialog

  29. Database Picker here Database Solution Data Project Web Project Test Project

  30. I use Petshop database to demo The Category table will be use (3 columns)

  31. Click Test button to test connecting Name: define name Provider Type: SqlSchemaProvider Connection String: use to connect to SqlServer, string connect as the same in the .Net. So you could copy & paste from .Net

  32. When select Datasource from Database picker, You will see the result in the left slide You could change location DataContext here Now, click Generate button

  33. In the E:/example folder In the Petshop.Data, open Petshop.Data.csproj

  34. Right click on the Petshop.Data.csp and choose Generate Outputs

  35. Take the tour Generate : References Entities Maps Models Queries EntityBase DataContext

  36. References

  37. Entities

  38. Maps: Entities Columns in table Functions  Store Procedure Views  View in database

  39. Maps: Entities Columns in table

  40. Maps: Functions  Store Procedure

  41. Maps: Views  View in database

  42. Models

  43. Queries

  44. EntityBase PetshopDataContext

  45. Petshop.UI Open Web.config, you will see connectionStrings tag as below: I add new WebForm1.aspx to test

  46. Petshop.UI Right click on Project / Add new Item/ WebForm

  47. Get List Categories

  48. Selected ListBox

  49. Delete Category

More Related