UnitOfWork and Repository pattern issues with primative types

UnitOfWork and Repository pattern issues with primative types

Postby mcinnes01 » Wed 31 Oct 2012 17:10

Hi,

I am struggling getting going with dotConnect for Oracle, I have sucessfully used it in a few simple applications to benefit from the direct connection to oracle. However I am now trying to use it to aid me with the development of some quite complex (for me any way) web applications.

What I will be doing in my first application is querying the HR system to create an org chart using Teleriks OrgChart Object.

The data lives in a few different tables and I am only interested in a few fields from each table.

I am wanting to use EF and also implement unitOfWork and Repository Pattern.

I noticed there is a new option when using the entity developer wizard that produces unitOfWork and Repository pattern for your entity.

So far I haven't managed to get it working at all, with issues with primative types and then also errors now not going away at all when I modify the entities in both the conceptual and physical mappings. I have had this part work before and have retrieved data in this way but since the last upgrade I just get errors with VARCHAR2.

The database I am mapping to is not intelligently made in fact is a make shift port from a FAT system to an oracle database provided by our HR systems provider, hence there are no relationships or anything clever in the database. Even Keys are a bit random!

I kind of know what I need to do with the mappings as I have had this working before, but now all I get is primative type errors on VARCHAR2.

Can any one help?

The database is poor as I explain so in order to get the data I need the following relationships need to be established and I would like to use the UnitOfWork/Repository Pattern.

There are 3 tables I need to use and 1 I would use twice.

So there is a "POSITION" table which hold job details, a "RELATIONSHIP" table that hold management structure and a "DETAILS" table that holds staff details.

The POSITION table has EmpID, StartDate, EndDate, JobCode, JobTitle.
The RELATIONSHIP table has JobCode and ManagerJobCode
The DETAILS table has EmpID, Forename, Surname and Telephone.

I need to join the POSITION table to the RELATIONSHIP table on JobCode and the POSITION table to the DETAILS table on EmpID.

I also need to join the RELATIONSHIP table to another instance of the POSITION table on ManagerJobCode = JobCode and then EmpID on the second POSITION table to EmpID on the DETAILS table.

So in essence its POSITION to RELATIONSHIP to POSITION2 in order to find an employees manager.

I am using JobCode as the node ID for the OrgChart as it allows vacancies to show and also reduces the width as employees in the same job can then be listed within a particular node.

To help me get going I need to know how to use the entity developer with direct mode and the repository and unitofwork template, without getting the primative types issue. (PS I have changed the model settings to enable automatic syncronisation.

Then I need to know what the best way of establishing the described relationships will be in order to have a dataobject that can be used to furnish Telerik's OrgChart object with data.

Your help would be much appreciated,

Andy
mcinnes01
 
Posts: 19
Joined: Wed 27 Jun 2012 13:55

Re: UnitOfWork and Repository pattern issues with primative types

Postby Shalex » Thu 01 Nov 2012 17:46

mcinnes01 wrote:I kind of know what I need to do with the mappings as I have had this working before, but now all I get is primative type errors on VARCHAR2.

We have answered you at http://forums.devart.com/viewtopic.php?t=24678.

mcinnes01 wrote:The database is poor as I explain so in order to get the data I need the following relationships need to be established

You can create associations in the model even if there are no FK relationships between tables in the database.
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle