How to specify 1 to 0...1 mapping in abstract classes?

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
geddar
Posts: 3
Joined: Tue 05 Jul 2011 07:19

How to specify 1 to 0...1 mapping in abstract classes?

Post by geddar » Tue 05 Jul 2011 07:29

Hi, DEVART team!
I've got some problems with my mapping schema:

http://dostavka-61.ru/img/db_schema.jpg
Now I need to associate 1 Message with 0...1 Attachment, but every time I try to specify mapping, I got an error.

Full project is here: http://dostavka-61.ru/img/MailManager.zip
Can anyone help me?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 06 Jul 2011 10:58

You should have specified the Referential Constraint Properties for the Message_Attachment association.
I have sent the modified model to the e-mail address you provided in your forum profile.

geddar
Posts: 3
Joined: Tue 05 Jul 2011 07:19

Post by geddar » Thu 07 Jul 2011 07:44

AndreyR wrote:You should have specified the Referential Constraint Properties for the Message_Attachment association.
I have sent the modified model to the e-mail address you provided in your forum profile.
Thanks very much! This helps me, but I've got another problem:
I've included my files "MailManager.Diagram1.view", "MailManager.edml", "MailManager.edps" in my VS 2010 project. Then, after build, I've got an exception:
"Mapping and metadata information could not be found for EntityType 'Agro2010Model.Message'.
In 'Model Settings' I've chosen "EmbedInOutputAssembly" artifact processing.
When I tried to change it to "CopyToOutputDirectory", I've got the same result. In both cases, generated files are in the "obj/debug" directories. Generated connection string is @"metadata=res://*/MailManager.csdl... I've tried to change it in many ways, but all my attempts were wasted.
What's wrong?

Cпасибо! Это мне помогло, но появилась другая проблема:
Я включил файлы "MailManager.Diagram1.view", "MailManager.edml", "MailManager.edps" в проект. Билдится без ошибок, но при запуске вылетает исключение:
"Mapping and metadata information could not be found for EntityType 'Agro2010Model.Message'"
В настройках модели я выставлял оба способа включения метаданных, но это мне не помогло, хотя что xml-схемы, что библиотека, создаются и помещаются в "obj/debug". EntityDeveloper генерит строку содинения @"metadata=res://*/MailManager.csdl... И я прописывал все варианты вплоть до указания абсолютного пути до файлов, но всё тщетно.
Что не так? Заранее спасибо!

geddar
Posts: 3
Joined: Tue 05 Jul 2011 07:19

Post by geddar » Mon 11 Jul 2011 00:47

UP

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 11 Jul 2011 14:19

Thank you for the additional information, I have reproduced the issue.
We will let you know about the results of our investigation.

Post Reply