Reverse engineering

Posts   
 
    
JustMe
User
Posts: 4
Joined: 20-Feb-2011
# Posted on: 20-Feb-2011 19:34:00   

Hello . I'm beginning to learn LLBL Gen and Nhibernate. I've got MySQL database and I want to get entity classes from it. It seems to call reverse engineering. I still can't find any information about it. May be someone can tell where this information is situated?

PS. I tried to use Google.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Feb-2011 20:11:21   

Hi JustMe simple_smile

Are you referring to the way LLBLGen get your database information? Well you have two ways to get started with a project:

  1. Database first. This means you say to LLBLGen what database you want to map and LLBLGen obtain your database metadata. This is the information_schema in the case o MySql. Then all your database objects are available so you can map those you want into entity objects, typed views, and build your own typed lists. Video example: http://llblgen.com/Pages/Files/Videos/LLBLGenProv3.0_EF_DBFirst.html

  2. Model first. This means you first design your entities in LLBLGen and then you sync your changes with your DB. LLBLGen will generate a DDL script you can use to create/alter your database. Video example: http://llblgen.com/Pages/Files/Videos/LLBLGenProv3.0_QuickModel.html

You can find more info about this in the manual.

David Elizondo | LLBLGen Support Team
JustMe
User
Posts: 4
Joined: 20-Feb-2011
# Posted on: 20-Feb-2011 21:42:18   

I did so but when it needed to specify the elements to retrieve I got a list of my databases without their names. I tried to select one of them and got exception :

Exception type: ArgumentNullException Value cannot be null. Parameter name: key

Is it bug of LLBL Gen or MySQL? Or may be it is my fault?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 21-Feb-2011 09:10:15   

Is there a stack trace for this exception? Which Designer version (release date, please) are you using?

JustMe
User
Posts: 4
Joined: 20-Feb-2011
# Posted on: 21-Feb-2011 10:59:47   

Stack trace :

LLBLGen Pro version 3.1. Build February 7th, 2011

-----[Core exception]--------------------
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.AddElementsToRetrieveToContainer( Dictionary`2 container, String catalogName, String schemaName, IEnumerable`1 tables, IEnumerable`1 views, IEnumerable`1 procs, IEnumerable`1 synonyms)
   at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.GetElementsToRetrieve()
   at SD.LLBLGen.Pro.Gui.Forms.MetaDataRetrievalWizard._mainWizardControl_SelectedPageChanging(Object sender, WizardPageChangingEventArgs e)
   at DevExpress.XtraWizard.WizardControl.RaiseSelectedPageChanging(BaseWizardPage oldPage, BaseWizardPage newPage, Direction direction)
   at DevExpress.XtraWizard.WizardControl.SetSelectedPageCore(BaseWizardPage prevPage, BaseWizardPage value, Direction direction)
   at DevExpress.XtraWizard.WizardControl.SetNextPage()
   at DevExpress.XtraWizard.WizardControl.OnNextButtonClick(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e)
   at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.Utils.Controls.ControlBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I use MySQL .NET Connector 6.2.4 LLBL Gen Pro 3.1 Trial MySQL 5.1.53 Windows XP

Any information else needs?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 21-Feb-2011 11:35:02   

The MySQL connector shipped by MySQL isn't supported, we only support DevArt's MySQL connector for MySQL. (which can give a bit of a problem with nhibernate).

The main issue is that the driver isn't properly optimized for the MySQL connector and can give problems later on, as the meta-data retrieval code in the driver might not work properly using the MySQL connector shipped by MySQL.

From your description you use the Mysql Connector you can download from MySql itself, correct?

Frans Bouma | Lead developer LLBLGen Pro
JustMe
User
Posts: 4
Joined: 20-Feb-2011
# Posted on: 21-Feb-2011 11:55:29   

Yes, I use connector downloaded from http://dev.mysql.com/downloads/connector/net/1.0.html#downloads

Are you planning to support MySQL connector shipped by MySQL anywhen? What can you advise?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 21-Feb-2011 18:29:56   

There are plans for supporting it, however we can't give you a date. The problem was that due to serious lack of documentation we couldn't create a specific driver for this connector using the code we have for the devart one. In theory it should be minor, but we had to wade through the sourcecode of the mysql connector to find information and I don't know if you've ever looked at that sourcecode, but ... it isn't really readable (and I express myself kindly there wink ).

So we had to make a decision and postpone the work on the driver.

Frans Bouma | Lead developer LLBLGen Pro