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

[Solved] Several questions with open access

3 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David
Top achievements
Rank 1
David asked on 17 Dec 2010, 11:16 AM

Hello. I'm evaluating OpenAccess ORM for my next project. After playing with it for a couple of hours, I still couldn't find the answers on my questions. I come from EF and LINQ2SQL and I want to change the orm due to the lack of the missing features I faced during my development time. Here's the questions:

1) I need to support at least 2 major dbms, SQL Server and Oracle. I know OA ORM supports both of them, and many more. That's great, but still, I couldn't find an option to forward map my entities (generated from sql server database), to oracle or any other database. How is it accomplished?

2) I need to implement a volatile, non storage property on my entity class. I know partial class is a solution here, but maybe there is a more clean solution of doing it? In "Model Explorer" window, I see "Implemented Properties" section, which is empty, however, I was not able to implement any property yet :) Could you give me an explenation what it means? I couldn't find anything in documentation.

3) Combining 2 tables in 1 entity. I'll describe my problem here. I need to support multi language support in my project. dynamic data should be translated in different languages. For that, I have 2 table for each translatable business object, for example:

  • Table Service:
  • Id int PK
  • ProviderId int
  • CreateDate DateTime
    etc
  • Table ServiceLocale:
  • Id int pk
  • ServiceId int
  • Name nvarchar(15)
  • Description nvarchar(20)
    etc

As you can see, I want to combine Service and ServiceLocal tables in one single entity called Service for example. When I faced the problem in EF, I was not able to solve that problem. EF did support inheritance, but only with one to one table relationship and I need one to many relationship support (Service should have more than one ServiceLocale). Does OA ORM support this situation?

4) Is it possible to implement a custom calculated property which will do calculations with my own code without introducing partial class?

I think that's it from now. If I'll have any more questions, I'll ask here :)

Thank you for your support.



3 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 18 Dec 2010, 07:06 PM
Hello? nobody to help? :(
0
Alexander
Telerik team
answered on 20 Dec 2010, 03:57 PM
Hello David,

1. You can use the Update Database from Model wizard to update the database schema at any time, based on the current state of your domain model. The same DDL scripts can be created at runtime as well via our database migration API.
However, we do not recommend reverse-mapping a database from one backend and forward-mapping it to another (like switching from mssql to oracle). This is because the reverse mapped model could contain backend specific settings which would not work with other backends. The best way to achieve your goal would be to use entirely forward mapping - without creating any tables in the designer but only classes, and update the schema at runtime. This way the generated DDL script will always use the OpenAccess default mapping mechanism, which respects the currently selected backend.
Please let us know if you would like to know in details how to do that.

2. The Implemented Properties compartment contains the properties inherited from the base classes (if there are any). This is not actually related to what you are trying to achieve here.

3. I am afraid that this scenario is not supported. It is possible to declare inheritance only on tables in a 1:1 relation. A possible solution to that problem could be creating a view that exposes the data from the two tables and mapping this view to a class. However, it is not guaranteed that create/update operations will work correctly on views without using any custom stored procedures.

4. You will not be able to extend your classes with custom code in the automatically generated files because they are overwritten every time when the model is saved. At the moment declaring a partial class is the only option.

I hope this sheds some light on the current abilities of OpenAccess and will help you decide whether to use it for your project. Please do not hesitate to contact us if you have any other questions or need more details on how to use our product.

Greetings,
Alexander
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
David
Top achievements
Rank 1
answered on 21 Dec 2010, 04:29 PM
Aalright, now it's much clear :) Though it doesn't support question 3, OA orm is the best solution I've ever worked with. Also I had some problems with model designer, when updating existing schema from database, the changes did not reflected. I don't know if this is the place to discuss this issue, but anyway, it's not a problem for me as I'm going to use forward mapping. Thanks 
Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Alexander
Telerik team
Share this question
or