Skip to content

Commit

Permalink
Adapted RUtil.getTableName to use @table annotation.
Browse files Browse the repository at this point in the history
Updated one of OpenDJ samples.
  • Loading branch information
mederly committed Jun 18, 2015
1 parent ff0bc23 commit 96d996c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Expand Up @@ -58,6 +58,7 @@
import org.hibernate.tuple.entity.EntityMetamodel;
import org.w3c.dom.Element;

import javax.persistence.Table;
import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;

Expand Down Expand Up @@ -418,6 +419,10 @@ public static String getDebugString(RObject object) {
}

public static String getTableName(Class hqlType) {
Table tableAnnotation = (Table) hqlType.getAnnotation(Table.class); // TODO what about performance here? (synchronized call)
if (tableAnnotation != null && StringUtils.isNotEmpty(tableAnnotation.name())) {
return tableAnnotation.name();
}
MidPointNamingStrategy namingStrategy = new MidPointNamingStrategy();
return namingStrategy.classToTableName(hqlType.getSimpleName());
}
Expand Down
Expand Up @@ -76,13 +76,12 @@ object.
<icfcldap:port>1389</icfcldap:port>
<icfcldap:host>localhost</icfcldap:host>
<icfcldap:baseContext>dc=example,dc=com</icfcldap:baseContext>
<icfcldap:bindDn>cn=idm,ou=Administrators,dc=example,dc=com</icfcldap:bindDn>
<icfcldap:bindDn>uid=idm,ou=Administrators,dc=example,dc=com</icfcldap:bindDn>
<icfcldap:bindPassword>
<t:clearValue>secret</t:clearValue>
</icfcldap:bindPassword>
<icfcldap:pagingStrategy>auto</icfcldap:pagingStrategy>
<icfcldap:vlvSortAttribute>entryUUID</icfcldap:vlvSortAttribute>
<icfcldap:accountOperationalAttributes>ds-pwp-account-disabled</icfcldap:accountOperationalAttributes>
<icfcldap:operationalAttributes>ds-pwp-account-disabled</icfcldap:operationalAttributes>
<icfcldap:operationalAttributes>isMemberOf</icfcldap:operationalAttributes>
</icfc:configurationProperties>
Expand Down Expand Up @@ -133,7 +132,7 @@ object.
<default>true</default>
<objectClass>ri:inetOrgPerson</objectClass>
<attribute>
<ref>icfs:name</ref>
<ref>ri:dn</ref>
<displayName>Distinguished Name</displayName>
<limitations>
<minOccurs>0</minOccurs>
Expand All @@ -159,7 +158,7 @@ object.
</outbound>
</attribute>
<attribute>
<ref>icfs:uid</ref>
<ref>ri:entryUUID</ref>
<displayName>Entry UUID</displayName>
<limitations>
<access>
Expand Down Expand Up @@ -306,7 +305,14 @@ object.
</iteration>

<protected>
<icfs:name>cn=idm,ou=Administrators,dc=example,dc=com</icfs:name>
<filter>
<q:equal>
<q:matching>http://prism.evolveum.com/xml/ns/public/matching-rule-3#distinguishedName</q:matching>
<q:path>attributes/ri:dn</q:path>
<!-- WilDCapiTaLIzaTioN and spacing makes sure that this is matched properly -->
<q:value>uid=idm,ou=Administrators,dc=example,dc=com</q:value>
</q:equal>
</filter>
</protected>

<activation>
Expand Down

0 comments on commit 96d996c

Please sign in to comment.