This is a migrated thread and some comments may be shown as answers.

Help, Reverse Mapping: Object reference not set to an instance of an object.

7 Answers 140 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alex
Top achievements
Rank 1
Alex asked on 20 Apr 2010, 03:13 AM
I'm trying to evaluate OpenAccess at the moment, although I can't seem to get the reverse mapping to work correctly. (And the error message is not very helpful)
The error is "Object reference not set to an instance of an object." and it shows up when I try to generate the reverse mapping, or when i just preview it in the advance view.
It appears on all the tables EXCEPT staff and tennant

Here is a link to a diagram of the database:
Database Diagram
Can anyone help me out?


*edit*
I've redone MANY of my primary keys
Re did all the... relations and everything
Now it is able to show previews of all tables, except CashSale and Banking, thou I still have no idea why this would change...
*end edit*
*final edit*
Bah... The reverse mapping wasn't picking up the foreign keys correctly.. (Don't know why?)
As I have multiple primary keys (multi-tenant data + child tables) and multiple foreign keys, OA wasn't picking up all the require columns (and had left some blank in the wizard).
*end final edit*

The only things of interest that I can think of is
-Some of the relations cascade, and there are triggers in place on the Staff_Tenant delete/update to allow for cascade deleteing. (I had to use triggers specifically to prevent a circular cascade error). The only other relation not cascading is staff-cashsale and staffsite-tenant (although when tenant is deleted, it should delete staff and site, thus deleteing staffsite, similarly with update)
-The trigger in tenant allows for multi row delete, but only single row update other wise I can't identify the individual rows being updated)
-tenantid is auto incremented (nothing else is auto incremented)



VS 2010 Pro
Telerik OpenAccess Q1 2010

7 Answers, 1 is accepted

Sort by
0
Zbigniew Kozłowski
Top achievements
Rank 1
answered on 20 Apr 2010, 12:29 PM
Hi,
i had same problem with MySQL and Identifying Relationship when ive changed to Non-Identifying Relationship it works, but id like to know also whats wrong with it.

Regards,
Zbigniew Kozłowski
0
Alex
Top achievements
Rank 1
answered on 20 Apr 2010, 12:39 PM
I found it was happening to mine because it wasn't creating the relations properly. The wizard would only pick like 75% of the variables in the FK/PK's. So I had to manually go in and reselect all the variables in the relations. Although I really think it should give a more descriptive error (as clearly x columns != y columns is easy to check) such as what is wrong, and where.
0
Ady
Telerik team
answered on 21 Apr 2010, 01:24 PM
Hi Alexander Sun,
 
 We would like to help you Reverse map the entire schema successfully. Is it possible to provide us with your schema? Maybe there are certain column types that cause the problem.

All the best,
Ady
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Alex
Top achievements
Rank 1
answered on 22 Apr 2010, 12:52 AM
Ok, I've sent a support ticket with an attached db

Your ticket ID is : 302754


also i think it is related to my post Link
0
Ady
Telerik team
answered on 22 Apr 2010, 11:56 AM
Hi Alexander Sun,
 
 We did receive your schema and could reproduce the incomplete mapping. We are looking into the cause and will get back to you. In the meantime you can manually assign the missing mapping (tenantid) and generate the class.

We are sorry for the inconvenience caused.

All the best,
Ady
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Charlie
Top achievements
Rank 1
answered on 20 Oct 2010, 06:13 PM
Running into the same issue - 

Any solution here?
0
Ady
Telerik team
answered on 26 Oct 2010, 09:36 AM
Hi Charlie,

 This was caused due to certain incomplete mapping for reference fields. Can you provide the version of the product that you are using? Maybe updating to the latest available version will help resolving the error.
Can you send us your reversemapping.config file so that we can ascertain the exact cause. You can attach the file by opening a support ticket.

Looking forward to your reply.

Sincerely yours,
Ady
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Getting Started
Asked by
Alex
Top achievements
Rank 1
Answers by
Zbigniew Kozłowski
Top achievements
Rank 1
Alex
Top achievements
Rank 1
Ady
Telerik team
Charlie
Top achievements
Rank 1
Share this question
or