Llbl Gen + MySQL quick development

Source: Internet
Author: User

Llbl Gen + MySQL quick development

 

MySQL installation Configuration

Install MySQL and use the query analyzer to connect to the Database Server

Create a database CTU and a new table agent

Add three pieces of data to the data table agent, Jack, Tony, and Charles.

The database design task ends here. Remember to add a primary key to each table. The primary key set here is name.

Llbl Gen design entity model

Start llbl Gen 3.1 and create a new project. select target as the llbl Gen framework.

In the category Explorer window, right-click to add a new connection.

Select reverse-engineer tables to entity definitions from the context menu

These tables are automatically mapped to the object set.

We can see that the agent table has been found.

To further edit the ing between attributes and fields, use the edit menu to open the form.

Here, you can set the link and the ing name.

F7, you can start generatingCode

By default, two project files are generated.

It can be seen from the name that one is unrelated to the database, and the other is for data access. The principle is that when we generate a database, we select the adapter mode instead of the selfservicing mode.

 

Start Program

Open the generated code in Visual Studio and add a test project (console)

Solution in the browser, there are currently three projects. Main is used to test data access.

Let's take a look at the main method. There are only a few simple lines of programs, that is, the simplest test program.

It generates the SQL statement select name, postion, description from agent.

Conclusion conclusion

1. The benefit of ORM is that it is a cross-database platform independent of database vendors. Taking MYSQL as an example, the project written using SQL Server can be easily transferred to the MySQL database platform.

Llbl Gen + Oracle quick development manual will be released in the near future.

 

2. so far, SQL Server has several stable and useful versions: SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, and SQL express series, if you want to migrate data from one database to another, consider these databases as different product series. It is really painful to migrate data in these product series. For example, once a database of SQL Server 2005 is attached to SQL Server 2008, it will no longer be able to attach data to SQL Server 2005. This kind of embarrassment also occurs between 2000 and 2005.

Considering versatility, SQL Server 2005 is recommended.

 

3. forward and reverse thinking
When learning about nhib.pdf, we are constantly studying where to store the ing files (database fields and. NET attributes. At that time, the expert's opinion was that it was not easy to put the XML file into the C # file for maintenance.

Later I came into contact with the commercial Nhibernate designer, but it wrote the ing file to the C # file. Because all these mappings are visually generated and do not need to be edited. Similarly, llbl Gen also puts the ing file in the C # code, which is also automatically generated.

I know the complexity of the settings of the Nhibernate ing file, which has made it very difficult for many Nhibernate enthusiasts to develop quickly and flexibly.

When talking about the economy, I heard that the Chinese property market is declining internationally, and the declaration that house prices will fall, many experts also think that, but I also heard that, international hot money is still entering the Chinese property market. The urbanization process in China is not interrupted, and house prices are unlikely to fall.

What I want to express is that we have to get used to two kinds of thinking.

I often say that the EPN framework can be developed quickly. You may need to realize that this sentence is not correct. simple and rapid development hides a huge complexity in it. The complexity of quick development is hidden behind the scenes. If something goes wrong, Google and Baidu won't be able to help you. fast development is easy to understand, if there is a bug or a problem occurs, you can find it on the Internet. However, you cannot make many applications, and the code is repeated, so you cannot handle the changes in requirements.

 

4. llbl gen is a commercial ORM tool. Please do not ask for license from me.
When no one can help you, you can ask Google, Baidu for help, just take a try.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.