CodeGenerator Relationship-Mapping

Dec 1, 2010 at 5:11 PM

Hi,

Just downloaded the ORM tool, pointed it at an Oracle 10xe database, generated some classes and it's looking good.

I haven't managed to get the Relationship-Mapping working though. No keys are appearing in the "Select Foreign Key" pane for either "Parent Objects" or "Child Collections", and the "Generated Code" pane is empty. I've had a look at your sample web app and tried to name the FK as per database.mdf, but with no luck.

Am I doing something wrong, or is there a strict naming convention I should be following?

Any guidance would be most welcome.

Regards,

Curtinio

Coordinator
Dec 1, 2010 at 5:33 PM

I think there is a minor bug in the generator, such that when you first generate the class, the relationships stuff comes up blank.

Workaround is to just click away on another table and then click back to that original table, and it should all load at that point.

Let me know if that doesn’t fix it…

From: curtinio [mailto:notifications@codeplex.com]
Sent: Thursday, December 02, 2010 7:12 AM
To: postage@ihug.co.nz
Subject: CodeGenerator Relationship-Mapping [Picasso:236738]

From: curtinio

Hi,

Just downloaded the ORM tool, pointed it at an Oracle 10xe database, generated some classes and it's looking good.

I haven't managed to get the Relationship-Mapping working though. No keys are appearing in the "Select Foreign Key" pane for either "Parent Objects" or "Child Collections", and the "Generated Code" pane is empty. I've had a look at your sample web app and tried to name the FK as per database.mdf, but with no luck.

Am I doing something wrong, or is there a strict naming convention I should be following?

Any guidance would be most welcome.

Regards,

Curtinio

Read the full discussion online.

To add a post to this discussion, reply to this email (Picasso@discussions.codeplex.com@discussions.codeplex.com)

To start a new discussion for this project, email Picasso@discussions.codeplex.com@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.872 / Virus Database: 271.1.1/3290 - Release Date: 12/01/10 08:57:00

Dec 1, 2010 at 8:08 PM

Jeremy,

Thanks for the tremendously quick reply!

There is still a problem. I 've created classed for two Oracle tables, with a simple parent-child relationship. The parent table PROJECT has PK column PROJECT_SK. The child table FOLDER has column PROJECT_SK which references the same column in the parent table via FK relationship FK_FOLDER_PROJECT. Like I say, nice and simple.

I see both tables in the "Select Related Table" pane but nothing in "Select Foreign Key" or "Generated Code". When I click on the "Child Collections" radio button there' still no keys listed. Also, my "Generated Code" pane isn't split into two like your screenshot.

I appreciate it's difficult to follow what I'm on about. Maybe a screen shot would help...

...Thanks, curtinio.

Coordinator
Dec 12, 2010 at 12:45 PM

Hi Curtinio,

Sorry for the delayed response…

Is this issue unique to Oracle databases? Did you try any other?

Please take a look in Framework project, class COracleClient lines 16-23: (see below)

Its possibly something to do with that, I see there have been different syntaxes used at different times…

Normally, clicking on different tables will show all their columns, and when you choose one, you get one or two panels of code appear to copy and paste.

I haven’t been able to reproduce the error you are seeing, but I don’t have access to an Oracle database at the moment.

#Region "List All Tables"

Public Overrides ReadOnly Property SqlToListAllTables() As String

Get

Return "select tname from tab"

'SELECT table_name FROM user_tables

'SELECT table_name FROM all_tables

'SELECT table_name, comments FROM dictionary WHERE table_name LIKE 'user_%' ORDER BY table_name;

End Get

End Property

#End Region

From: curtinio [email removed]
Sent: Thursday, December 02, 2010 10:09 AM
To: postage@ihug.co.nz
Subject: Re: CodeGenerator Relationship-Mapping [Picasso:236738]

From: curtinio

Jeremy,

Thanks for the tremendously quick reply!

There is still a problem. I 've created classed for two Oracle tables, with a simple parent-child relationship. The parent table PROJECT has PK column PROJECT_SK. The child table FOLDER has column PROJECT_SK which references the same column in the parent table via FK relationship FK_FOLDER_PROJECT. Like I say, nice and simple.

I see both tables in the "Select Related Table" pane but nothing in "Select Foreign Key" or "Generated Code". When I click on the "Child Collections" radio button there' still no keys listed. Also, my "Generated Code" pane isn't split into two like your screenshot.

I appreciate it's difficult to follow what I'm on about. Maybe a screen shot would help...

...Thanks, curtinio.


No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1170 / Virus Database: 426/3310 - Release Date: 12/11/10

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.872 / Virus Database: 271.1.1/3290 - Release Date: 12/01/10 20:34:00

Dec 16, 2010 at 8:04 PM

Hi Jeremy,

Many thanks for your detailed response.

You’re right, I need to hook up to some other databases and see if I get the same behaviour – Plus getting into the code might be a good idea too.

Thanks again!