[jira] [Closed] (SYNCOPE-1217) Using the JAVA API is possible to create a Realm with the same name in the same parent realm

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (SYNCOPE-1217) Using the JAVA API is possible to create a Realm with the same name in the same parent realm

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/SYNCOPE-1217?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francesco Chicchiriccò closed SYNCOPE-1217.
-------------------------------------------
    Resolution: Not A Problem

The Unique Constrainst is defined here

https://github.com/apache/syncope/blob/2_0_X/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPARealm.java#L59-L60

and is applied when the statement is flushed to the database, not at the time of invoking {{save()}}.

> Using the JAVA API is possible to create a Realm with the same name in the same parent realm
> --------------------------------------------------------------------------------------------
>
>                 Key: SYNCOPE-1217
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-1217
>             Project: Syncope
>          Issue Type: Bug
>            Reporter: Filipe Silva
>            Priority: Trivial
>
> Using a code similar to this
> {code:java}
> ...
>                testRealm = entityFactory.newEntity(Realm.class);
>                 testRealm.setName('Test');
>                 orgUnitComputadoresRealm.setParent(realmDAO.getRoot();
>                 realmDAO.save(testRealm);
> ..
> {code}
> is possible to create a Realm with the same name in the same parent realm
> I think an exception should be triggered in the realmDAO.save call
> (Or the Database is missing a Unique key)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)