Bug 361348 - [DB] meta model elements/attributes marked 'ID' should be marked 'UNIQUE' in the database
Summary: [DB] meta model elements/attributes marked 'ID' should be marked 'UNIQUE' in ...
Status: NEW
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.db (show other bugs)
Version: 4.13   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-19 03:53 EDT by Erdal Karaca CLA
Modified: 2020-12-11 10:37 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erdal Karaca CLA 2011-10-19 03:53:58 EDT
In a RDBMS it is possible to add constraints to a table.
In particular, meta model elements marked 'ID' should be handled as follows:
Add a UNIQUE CONSTRAINT to the column of the appropriate table.

DDL:
alter table MYTYPE add constraint mytypeuniqueconstraint
check (myattribute is unique);
Comment 1 Eike Stepper CLA 2011-10-19 05:38:03 EDT
(In reply to comment #0)
> In a RDBMS it is possible to add constraints to a table.
> In particular, meta model elements marked 'ID' should be handled as follows:
> Add a UNIQUE CONSTRAINT to the column of the appropriate table.

Why do youthink we *should* do that? 
Just because it's possible?

I guess with auditing and branching that wouldn't that trivial...
Comment 2 Erdal Karaca CLA 2011-10-19 05:45:33 EDT
Of course, there is no obligation to do this at all, maybe, it was just wrong wording...

I did not consider auditing and branching as I have turned those features off (both are supported natively by the db storage).
Comment 3 Erdal Karaca CLA 2011-10-19 05:49:57 EDT
Note to the note in parenthesis in my last comment: auditing is supported, I have confused branching with replication...
Comment 4 Eike Stepper CLA 2011-10-19 06:09:02 EDT
(In reply to comment #2)
> Of course, there is no obligation to do this at all, maybe, it was just wrong
> wording...

Still I would like to learn about the benefit before we are going to change something. The fact that it's possible alone is not enough to justify effort and potential to break something.
Comment 5 Erdal Karaca CLA 2011-10-19 06:24:04 EDT
Isn't the ID flag in ecore meant to avoid duplicate objects in a resource?

If I want to avoid duplicate objects in CDO, I have to traverse the list and check whether that object already exists or not.
The db store supports this natively, so why not use it?
Comment 6 Eike Stepper CLA 2012-08-14 22:54:41 EDT
Moving all open issues to 4.2. Open bugs can be ported to 4.1 maintenance after they've been fixed in master.
Comment 7 Eike Stepper CLA 2013-06-27 04:04:55 EDT
Moving all outstanding enhancements to 4.3
Comment 8 Eike Stepper CLA 2014-08-19 09:21:34 EDT
Moving all open enhancement requests to 4.4
Comment 9 Eike Stepper CLA 2014-08-19 09:34:27 EDT
Moving all open enhancement requests to 4.4
Comment 10 Eike Stepper CLA 2015-07-14 02:17:02 EDT
Moving all open bugzillas to 4.5.
Comment 11 Eike Stepper CLA 2016-07-31 00:59:54 EDT
Moving all unaddressed bugzillas to 4.6.
Comment 12 Eike Stepper CLA 2017-12-28 01:18:52 EST
Moving all open bugs to 4.7
Comment 13 Eike Stepper CLA 2019-11-08 02:15:59 EST
Moving all unresolved issues to version 4.8-
Comment 14 Eike Stepper CLA 2019-12-13 12:51:30 EST
Moving all unresolved issues to version 4.9
Comment 15 Eike Stepper CLA 2020-12-11 10:37:54 EST
Moving to 4.13.