本文整理汇总了Java中org.odata4j.edm.EdmNavigationProperty.getFromRole方法的典型用法代码示例。如果您正苦于以下问题:Java EdmNavigationProperty.getFromRole方法的具体用法?Java EdmNavigationProperty.getFromRole怎么用?Java EdmNavigationProperty.getFromRole使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.odata4j.edm.EdmNavigationProperty
的用法示例。
在下文中一共展示了EdmNavigationProperty.getFromRole方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findMultiPoint
import org.odata4j.edm.EdmNavigationProperty; //导入方法依赖的package包/类
/**
* 1-0:Nの削除処理時にN側を検索処理を行う.
* @param np EdmNavigationProperty
* @param entityKey entityKey
* @return 存在する場合true
*/
public boolean findMultiPoint(final EdmNavigationProperty np, final OEntityKey entityKey) {
EdmAssociationEnd from = np.getFromRole();
EdmAssociationEnd to = np.getToRole();
if ((EdmMultiplicity.ONE.equals(from.getMultiplicity())
|| EdmMultiplicity.ZERO_TO_ONE.equals(from.getMultiplicity()))
&& EdmMultiplicity.MANY.equals(to.getMultiplicity())) {
// 検索して0件であることを確認する;
CountResponse cr = getNavPropertyCount(from.getType().getName(), entityKey, to.getType().getName(),
new EntityQueryInfo.Builder().build());
return cr.getCount() > 0;
}
return false;
}
示例2: deleteLinks
import org.odata4j.edm.EdmNavigationProperty; //导入方法依赖的package包/类
/**
* Delete N:N links.
* @param navigationProperty EdmNavigationProperty
* @param fromDocHandler dochandler
*/
private void deleteLinks(EdmNavigationProperty navigationProperty, EntitySetDocHandler fromDocHandler) {
EdmAssociationEnd from = navigationProperty.getFromRole();
EdmAssociationEnd to = navigationProperty.getToRole();
if (EdmMultiplicity.MANY.equals(from.getMultiplicity())
&& EdmMultiplicity.MANY.equals(to.getMultiplicity())) {
String toTypeName = to.getType().getName();
// In the case of links of user data, get _id of EntityType.
String toEntityTypeId = null;
if (UserDataODataProducer.USER_ODATA_NAMESPACE.equals(fromDocHandler.getType())) {
toEntityTypeId = getEntityTypeId(toTypeName);
}
// Get links up to the registered number limit.
EntitySetAccessor toEsType = getAccessorForEntitySet(toTypeName);
QueryInfo queryInfo = QueryInfo.newBuilder().setTop(PersoniumUnitConfig.getLinksNtoNMaxSize())
.setInlineCount(InlineCount.NONE).build();
List<String> idvals = LinkDocHandler.query(this.getAccessorForLink(),
fromDocHandler, toEsType.getType(), toEntityTypeId, queryInfo);
PersoniumSearchHits searchHits = ODataProducerUtils.searchLinksNN(idvals, toEsType, null);
if (searchHits == null || searchHits.getCount() == 0) {
return;
}
// Delete links.
for (PersoniumSearchHit hit : searchHits.getHits()) {
EntitySetDocHandler toDocHandler = getDocHandler(hit, toTypeName);
deleteLinkEntity(fromDocHandler, toDocHandler);
}
}
}