When will Unique Constraints be supported in Entity Framework? - entity-framework-5

I just got a rude awakening. EF Associations on Unique Constraints are not supported in EF5.
Some googling on the issue does not turn up much info...
Who can tell me when Unique Constraints will be supported in Entity Framework?
Thanks.
-d

Related

Is there tutorial available for Agro Uml Xmi

Have created the Sequence diagram using ArgoUML and exported it as XMI.
I need to identify the class,function and their relationships by parsing the XMI.
I can able to parse the class and their corresponding operation and attribute as explained in http://www.ibm.com/developerworks/library/x-wxxm24/#resources
Can any one help me in parsing the association role and classifier role in order to obtain their relationship?
The main thing that you need to know is that it's UML 1.4/1.5 serialized using XMI 1.2. ArgoUML uses the NetBeans UML/XMI support for writing these files, but it's been long since retired.
Good luck!

How can domain model classes (generated by EF 5 Database First) support custom logic when a database update replaces the code?

Please pardon the long-winded title to this post.
Basically, I have an entity model that was generated by Entity Framework 5 using the Database First method. Now I would like to develop those POCO entity classes by adding validation logic and anything else I might need to go in there. The problem... (and this is so glaring I can't believe I couldn't find any answer to this on the web)... is that any time my database schema should change and I use the "Update Model from Database" command from my model diagram, the POCO classes are re-generated and all custom code is lost.
As far as I understand, the "domain model" layer in an MVVM application is largely comprised of what EF generates (in database first approach), plus validation (perhaps implementing the IDataErrorInfo. But if this was the right way to do it, why would this be wiped away when using database-first model updates?
What am I missing?
Thanks
You should use partial classes. That is why they are there.
If you want to know the basics see this short example:
http://www.dotnetperls.com/partial
Here is more on partial classes from the msdn:
http://msdn.microsoft.com/en-us/library/vstudio/wa80x488.aspx
If you want to use your own namespaces in the genarted code, you can refer to this SO question:
Entity Framework 5 partial classes not working

Mapping UI elements in a Logical Data Model

I'm currently in a project where I have been asked to create a logical data model in UML. Now i've defined all my logical data entities and know all my attributes i'm just a little lost on how I can map these attributes to the UI.
The point of the exercise is to prove all the attributes in the requirements have been met in the system we have chosen to deploy. Happy to supply more information.
The application I am using is Enterprise Architect.
This question was solved the Enterprise Architect Support Forums.
Connect both classes with an association
Right click the assoc. near the class with attributes
Context menu/Link to Element Feature
Attributes
-> select the one and the assoc. is attached to it
There is an elegant approach which is to use Database stereotypes in your class diagram on attributes and then map it to java ORM annotation in the code.
I don't think EA can do this ORM mapping but other tools can.
Do you have artifacts in your model for the UI, too? That is, as a screen mock up or as a class model of the underlying UI classes? If yes, then you may find it very helpful to establish a traceability for your artifacts using a realization or dependency relationship.
You can further support that by creating requirement entities (in a SysML requirements diagram) and drag'n'drop the respective requirement onto the entity which provides a solution to it. This is described on page 31 in the following EA whitepaper: http://community.sparxsystems.com/whitepapers/Requirements%20Management%20with%20Enterprise%20Architect/Requirements_Management_in_Enterprise_Architect.pdf
I made a screenshot for you of how this looks, but unfortunately I am not yet allowed to post it here since I am a new member. Maybe you can get a rough idea from this screenshot I found on the web: http://www.sparxsystems.com.au/enterprise-architect/images/traceability_lg.png
That mechanism works on class level. On the attribute level you may want to add a link to specific related (requirements) elements in the notes field, if necessary.

CoreData lightweight migration: which exactly are "simple changes to your model" which CoreData can migrate automatically?

I'd like to use CoreData lightweight migration as much as possible, but could not find in the documentation, which exactly are the cases when this is possible. The documentation says:
If you just make simple changes to your model (such as adding a new attribute to an entity), on Mac OS X v10.6 and later and on iPhone OS, Core Data can perform automatic data migration.
For Core Data to be able to do this, the changes must fit an obvious migration pattern, for example:
- Simple addition of a new attribute
- A non-optional attribute becoming optional
- An optional attribute becoming non-optional, and defining a default value
Well, I tried out also adding a new entity without relationships and deleting an existing entity (without relationships) and that worked for me automatically as well.
The question is: does anybody know what exactly are the simple changes which can be migrated automatically?
From WWDC 2010 Session 118 Mastering Core Data*:
Inferable Changes supported by lightweight migration
Add, remove, rename
Attributes - numerical type conversion
Relationships - promote to-one to to-many
Entities - change entity inheritance
*Video requires Apple Developer login

Standard database neutral XSD to describe a relational database schema

Is anyone aware of a vendor neutral XSD to describe a relational database schema? Our system needs to grab information about the structure of a database:
Tables
Columns and types
Primary and Foreign Keys Constraints
Indexes
etc
in a vendor independent manner and store it in an XML file for later processing.
Before we do what we typically do and roll our own. I wanted to do some research and see if there was an existing XSD that people are standardizing on for what I assume is not an uncommon requirement for modeling tools and such. I did not find anything on Google that was not database vendor specific. If you know of an existing public standard I would very much appreciate a link.
Thanks in advance,
Terence
This isn't exactly what you're looking for, but the PostgresSQL Wiki has an interesting section on XML exports, that describes how they are supporting SQL and XML together. It displays a section on how a table would be exported as as XML and the XSD that would support it, which looks rather generic. It could serve as a model for you to create your own.
The Wiki talks about reference to a ISO/IEC 9075-14:2006 standard, that appears to be adopted by a few big vendors as a baseline. I quick browse on the ISO site says that :2006 was updated to 2008. I'm sure you can find a covered spec of this that you don't have to pay for to download.
The article also points to a SQL/XML standard definition that is a bit outdated, but could serve your needs if you're looking for some basics.
Interesting problem - I am not aware of any standard or tool to achieve this.
You would almost have to have some kind of a "neutralized" version with adapters for each individual database system you want to target - even just to map all the various data types (VARCHAR and NVARCHAR in SQL Server, VARCHAR2 in Oracle and so on).
You might just use the types defined in the SQL:2003 standard - but even then you'd probably still have to have some kind of a vendor-specific mapping / adaption of sorts. Not to mention some kind of support for vendor-specific implementation details (like IDENTITY columns in SQL Server vs. SEQUENCE in Oracle and others).
Very interesting question! I hope others will be able to shed more light on the issue and maybe recommend an existing tool.
If not, and you decide to roll your own - consider making it open-source on CodePlex or Google Code! I'm sure a lot of folks would be most interested!
MArc
The UML Information Management Metamodel (IMM) Specification from OMG may worth a try.

Resources