[ http://wso2.org/jira/browse/REGISTRY-96?page=comments#action_15003 ] Dimuthu Leelarathne commented on REGISTRY-96: ---------------------------------------------
Hi Norman, You can write a ORMRealm. You have to implement these interfaces. [1] You can make this ORMRealm pluggable with Acegi. Situation is that users are inside Acegi user store, and we want to add user/role permissions as required by the Registry using ORM. I faced the same situation when implementing the plain RDBMS realm. My situation was that users are in a separate store, but I had to maintain their permissions in my own database, because it is needed by Registry. The requirement was that I cannot maintain two user tables. I suppose you have the same requirement. Therefore I created a set of permission tables omitting the user_id, role_id as foreign key constraints. A sample would be as follows. CREATE TABLE UM_USER_PERMISSIONS (ID VARCHAR(255), PERMISSION_ID VARCHAR(255) NOT NULL, USER_ID VARCHAR(255) NOT NULL, IS_ALLOWED SMALLINT NOT NULL, UNIQUE (PERMISSION_ID, USER_ID), FOREIGN KEY (PERMISSION_ID) REFERENCES UM_PERMISSIONS(ID) ON DELETE CASCADE, PRIMARY KEY (ID)); The above table does NOT have " FOREIGN KEY (USER_ID) REFERENCES UM_USERS(ID) ". So in the same way your ORMRealm can have a specialized version where it supports users from Acegi. [1] https://wso2.org/repos/wso2/trunk/commons/usermanager/modules/core/src/main/java/org/wso2/usermanager/ Thank you, Dimuthu > ORM Spring JPA for data access > ------------------------------ > > Key: REGISTRY-96 > URL: http://wso2.org/jira/browse/REGISTRY-96 > Project: WSO2 Registry > Issue Type: Improvement > Environment: Windows, JBoss, MySQL, Spring JPA > Reporter: Norman Barker > Assigned To: Chathura Ekanayake > Attachments: WebRegistryORM.zip > > > I have ported the original code (at haste) to move from a das to an ORM > model. Most of the functionality has been ported, though querying and > versioning isn't supported. I have posted an initial version for review, to > check that this is an acceptable approach before complying with the test > suite / completing the remaining functionality. > This has been tested with JBoss / Hibernate. > Persistence.xml is at modules\core\src\main\resources\META-INF > applicationContext.xml is at modules\webapps\conf and contains the database > configuration > maven has been updated to pull the Spring JPA libraries. > Key advantages are the cascading deletes, object queries, and the use of > transaction automatically wrapping a method. > I need some feedback before I continue with this :-) > The ORMRegistry has highlighted that the usermanagement is dependent on a DAO > and isn't pluggable with Spring Acegi. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://wso2.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira _______________________________________________ Registry-dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
