soundasleep / iaml

Automatically exported from code.google.com/p/iaml
3 stars 1 forks source link

Cannot store both Types and Roles within the same DomainSource #201

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an application with a schema 'Event' and a role 'X'
2. Connect both the schema and the role to two separate DomainSources 
(default.db)
3. Create an iterator over Event
4. Try to access generated application

What is the expected output? What do you see instead?
Expected: The (empty) iterator can be accessed
Actual: The following error message is displayed:

For foreign key 'DomainAttribute_UserRole_Link Attribute 'root_user_id' 
[type='iamlInteger']': Could not find a schema in the source DomainSource 
'RELATIONAL_DB' [file='sqlite:default.db'] for attribute 
DomainAttribute_UserRoot_ID Attribute 'id' [type='iamlInteger']

This is because, as a Role-holding DomainSource, the source tries to access all 
of the contained schemas through foreign keys (the UserRoot ID attribute), 
whereas Event does not contain any. In particular, in the generated 
DomainSource:

/**
* Domain Source for Domain Store 'select event'
*/
class DomainSource_domain_1297cc93fc9_4 extends DomainSource {
private function __construct() {
  $this->schemas = array(DomainSchema_users_1297cc93fc9_6::getInstance(), DomainSchema_users_1297cc93fc9_5::getInstance(),
  DomainSchema_domain_1297cc93fc9_1::getInstance(), DomainSchema_users_1297cc93fc9_4::getInstance(), );
  // ...
}

The workaround is to put Roles into a separate database from other schemas 
(e.g. 'users.db').

Original issue reported on code.google.com by soundasleep on 28 Jun 2010 at 4:52

GoogleCodeExporter commented 9 years ago

Original comment by soundasleep on 28 Jun 2010 at 4:52

GoogleCodeExporter commented 9 years ago
renaming issue title as per resolved issue 263

Original comment by soundasleep on 8 Jul 2011 at 3:35

GoogleCodeExporter commented 9 years ago
mass tagging old issues to future work

Original comment by soundasleep on 26 Sep 2011 at 9:54