• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BooleanType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.hibernate.type.BooleanType的典型用法代码示例。如果您正苦于以下问题:Java BooleanType类的具体用法?Java BooleanType怎么用?Java BooleanType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BooleanType类属于org.hibernate.type包,在下文中一共展示了BooleanType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: get

import org.hibernate.type.BooleanType; //导入依赖的package包/类
protected Object get(Class clazz, String id) {
	if (clazz.equals(String.class) || clazz.equals(StringType.class)) return id;
	if (clazz.equals(Character.class) || clazz.equals(CharacterType.class)) return (id == null || id.isEmpty() ? null : id.charAt(0));
	if (clazz.equals(Byte.class) || clazz.equals(ByteType.class)) return Byte.valueOf(id);
	if (clazz.equals(Short.class) || clazz.equals(ShortType.class)) return Short.valueOf(id);
	if (clazz.equals(Integer.class) || clazz.equals(IntegerType.class)) return Integer.valueOf(id);
	if (clazz.equals(Long.class) || clazz.equals(LongType.class)) return Long.valueOf(id);
	if (clazz.equals(Float.class) || clazz.equals(FloatType.class)) return Float.valueOf(id);
	if (clazz.equals(Double.class) || clazz.equals(DoubleType.class)) return Double.valueOf(id);
	if (clazz.equals(Boolean.class) || clazz.equals(BooleanType.class)) return Boolean.valueOf(id);
	
	Map<String, Entity> entities = iEntities.get(clazz.getName());
	if (entities != null) {
		Entity entity = entities.get(id);
		if (entity != null) return entity.getObject();
	}
       for (Map.Entry<String, Map<String, Entity>> entry: iEntities.entrySet()) {
       	Entity o = entry.getValue().get(id);
       	if (o != null && clazz.isInstance(o.getObject())) return o.getObject();
	}
       if (clazz.equals(Session.class))
       	return ((Entity)iEntities.get(Session.class.getName()).values().iterator().next()).getObject();
       if (clazz.equals(Student.class))
       	return checkUnknown(clazz, id, iStudents.get(id));
       if (iIsClone)
       	return checkUnknown(clazz, id,
       			iHibSession.get(clazz, clazz.equals(ItypeDesc.class) ? (Serializable) Integer.valueOf(id) : (Serializable) Long.valueOf(id)));
       return checkUnknown(clazz, id, null);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:30,代码来源:SessionRestore.java


示例2: getPendingConnection

import org.hibernate.type.BooleanType; //导入依赖的package包/类
/**
	 * {@inheritDoc}
	 */
public ProfileFriend getPendingConnection(final String userId, final String friendId) {
	
	if(userId == null || friendId == null){
  		throw new IllegalArgumentException("Null Argument in getPendingConnection"); 
  	}
	
	HibernateCallback<ProfileFriend> hcb = session -> {
           Query q = session.getNamedQuery(QUERY_GET_FRIEND_REQUEST);
           q.setParameter(USER_UUID, userId, StringType.INSTANCE);
           q.setParameter(FRIEND_UUID, friendId, StringType.INSTANCE);
           q.setParameter(CONFIRMED, false, BooleanType.INSTANCE);
           q.setMaxResults(1);
           return (ProfileFriend) q.uniqueResult();
     };

	return getHibernateTemplate().execute(hcb);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:21,代码来源:ProfileDaoImpl.java


示例3: addScalars

import org.hibernate.type.BooleanType; //导入依赖的package包/类
private void addScalars(SQLQuery query)
{
	query.addScalar("URI", StringType.INSTANCE);
	query.addScalar("foundTimestamp", LongType.INSTANCE);
	query.addScalar("canonicalTag", StringType.INSTANCE);
	query.addScalar("httpStatusCode", IntegerType.INSTANCE);
	query.addScalar("lastCrawledTimestamp", LongType.INSTANCE);
	query.addScalar("contentHashcode", StringType.INSTANCE);
	query.addScalar("backgroundId", ShortType.INSTANCE);
	query.addScalar("qualityScore", ShortType.INSTANCE);
	query.addScalar("spamScore", ShortType.INSTANCE);
	query.addScalar("readingLevel", ShortType.INSTANCE);
	query.addScalar("varietyTopicScore", ShortType.INSTANCE);
	query.addScalar("adScripts", ShortType.INSTANCE);
	query.addScalar("relevantImages", BooleanType.INSTANCE);
	query.addScalar("responseTime", IntegerType.INSTANCE);
	query.addScalar("pageSize", IntegerType.INSTANCE);
	query.addScalar("pageRank", DoubleType.INSTANCE);
	query.addScalar("qwLocale", StringType.INSTANCE);
	query.addScalar("onPageText", StringType.INSTANCE);
	query.addScalar("title", StringType.INSTANCE);
	query.addScalar("metaDescription", StringType.INSTANCE);
	query.addScalar("topicKeyword", StringType.INSTANCE);
	query.addScalar("robotsIndex", BooleanType.INSTANCE);
	query.addScalar("duplicateTitle", BooleanType.INSTANCE);
	query.addScalar("duplicateMetaDescription", BooleanType.INSTANCE);
	query.addScalar("duplicateContent", BooleanType.INSTANCE);
	query.addScalar("trailingSlashIssue", BooleanType.INSTANCE);
	query.addScalar("timeout", BooleanType.INSTANCE);
	query.addScalar("pagination", BooleanType.INSTANCE);
	query.addScalar("dcPrimary", BooleanType.INSTANCE);
}
 
开发者ID:bonprix,项目名称:solidsearch-bot,代码行数:33,代码来源:URLRestManager.java


示例4: getAreaControlPermissionByRoleAndType

import org.hibernate.type.BooleanType; //导入依赖的package包/类
public ControlPermissions getAreaControlPermissionByRoleAndType(final String roleId, final String typeId, final boolean defaultValue) {
    log.debug("getAreaControlPermissionByRole executing for current user: " + getCurrentUser());
    final Area area = areaManager.getAreaByContextIdAndTypeId(typeId);
    if (area == null) {
        return null;
    }
    HibernateCallback<ControlPermissions> hcb = session -> {
        Query q = session.getNamedQuery(QUERY_CP_BY_ROLE);
        q.setParameter("roleId", roleId, StringType.INSTANCE);
        q.setParameter("areaId", area.getId().toString(), StringType.INSTANCE);
        q.setParameter("defaultValue", defaultValue, BooleanType.INSTANCE);
        return (ControlPermissions) q.uniqueResult();
    };
    return getHibernateTemplate().execute(hcb);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:16,代码来源:PermissionManagerImpl.java


示例5: getControlPermissionByKeyValue

import org.hibernate.type.BooleanType; //导入依赖的package包/类
private ControlPermissions getControlPermissionByKeyValue(final String roleId, final String key, final String value, final boolean defaultValue) {
    log.debug("getAreaControlPermissionByRole executing for current user: " + getCurrentUser());
    HibernateCallback<ControlPermissions> hcb = session -> {
        String queryString = "forumId".equals(key) ? QUERY_CP_BY_FORUM : QUERY_CP_BY_TOPIC;
        Query q = session.getNamedQuery(queryString);
        q.setParameter("roleId", roleId, StringType.INSTANCE);
        q.setParameter(key, value, StringType.INSTANCE);
        q.setParameter("defaultValue", defaultValue, BooleanType.INSTANCE);
        return (ControlPermissions) q.uniqueResult();
    };
    return getHibernateTemplate().execute(hcb);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:13,代码来源:PermissionManagerImpl.java


示例6: getMessagePermissionByKeyValue

import org.hibernate.type.BooleanType; //导入依赖的package包/类
private MessagePermissions getMessagePermissionByKeyValue(final String roleId, final String key, final String value, final boolean defaultValue) {
    log.debug("getAreaMessagePermissionByRole executing for current user: " + getCurrentUser());
    HibernateCallback<MessagePermissions> hcb = session -> {
        String queryString = "forumId".equals(key) ? QUERY_MP_BY_FORUM : QUERY_MP_BY_TOPIC;
        Query q = session.getNamedQuery(queryString);
        q.setParameter("roleId", roleId, StringType.INSTANCE);
        q.setParameter(key, value, StringType.INSTANCE);
        q.setParameter("defaultValue", defaultValue, BooleanType.INSTANCE);
        return (MessagePermissions) q.uniqueResult();
    };
    return getHibernateTemplate().execute(hcb);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:13,代码来源:PermissionManagerImpl.java


示例7: getAreaMessagePermissionByRoleAndType

import org.hibernate.type.BooleanType; //导入依赖的package包/类
public MessagePermissions getAreaMessagePermissionByRoleAndType(final String roleId, final String typeId, final boolean defaultValue) {
    log.debug("getAreaMessagePermissionByRole executing for current user: " + getCurrentUser());
    final Area area = areaManager.getAreaByContextIdAndTypeId(typeId);
    if (area == null) {
        return null;
    }
    HibernateCallback<MessagePermissions> hcb = session -> {
        Query q = session.getNamedQuery(QUERY_MP_BY_ROLE);
        q.setParameter("roleId", roleId, StringType.INSTANCE);
        q.setParameter("areaId", area.getId().toString(), StringType.INSTANCE);
        q.setParameter("defaultValue", Boolean.valueOf(defaultValue), BooleanType.INSTANCE);
        return (MessagePermissions) q.uniqueResult();
    };
    return getHibernateTemplate().execute(hcb);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:16,代码来源:PermissionManagerImpl.java


示例8: buildSqlRestriction

import org.hibernate.type.BooleanType; //导入依赖的package包/类
private Criterion buildSqlRestriction(String sqlRestriction, Object value) {
	try {
		String result = sqlRestriction;
		int first = result.indexOf("@");
		List<Object> values = new ArrayList<Object>();
		List<Type> types = new ArrayList<Type>();
		while (first != -1) {
			String parameter = result.substring(first);
			int second = parameter.indexOf("@", 1);
			if (second == -1) {
				LOG.warn("There are a sql restrictoion not well formed, the sql restriction is: '{}' for bean class {} ",
						sqlRestriction, beanClass.getName());
				break;
			}
			parameter = parameter.substring(0, second + 1);
			String parameterWithoutRim = parameter.substring(1, parameter.length() - 1);
			Map<String, Object> mvelContext = new HashMap<String, Object>();
			mvelContext.put("source", value);
			Object parameterValue = MVEL.eval(parameterWithoutRim, mvelContext);
			// TODO Make more types
			if (String.class.isAssignableFrom(parameterValue.getClass())) {
				values.add(parameterValue);
				types.add(StringType.INSTANCE);
			} else if (Boolean.class.isAssignableFrom(parameterValue.getClass())) {
				values.add(parameterValue);
				types.add(BooleanType.INSTANCE);
			} else {
				throw new UnsupportedOperationException();
			}
			result = result.substring(0, first) + "? " + result.substring(second + first + 1);
			first = result.indexOf("@");
		}
		Type[] t = new Type[types.size()];
		return Restrictions.sqlRestriction(result, values.toArray(), types.toArray(t));
	} catch (CompileException ex) {
		LOG.warn(String.format("Compiling validation expression '%s' of class '%s' has thrown an error: %s", sqlRestriction,
				beanClass.toString(), ex.getMessage()), ex);
		return Restrictions.sqlRestriction("0=1");
	}
}
 
开发者ID:frincon,项目名称:openeos,代码行数:41,代码来源:UIBeanSelectorProvider.java


示例9: getReturnType

import org.hibernate.type.BooleanType; //导入依赖的package包/类
@Override
public Type getReturnType(Type firstArgumentType, Mapping mapping) throws QueryException{
    return new BooleanType();
}
 
开发者ID:EsupPortail,项目名称:esup-dematec,代码行数:5,代码来源:PgFullTextFunction.java


示例10: getUserOpenTextAttemptsForTablesorter

import org.hibernate.type.BooleanType; //导入依赖的package包/类
@Override
   @SuppressWarnings("unchecked")
   /**
    * Gets the details about an open text entry. Either sessionUid or toolContentId must be supplied - if sessionUid is
    * supplied
    * then it will be restricted to that session. Due to the large number of fields needed, a DTO will be returned.
    *
    * Will return List<OpenTextAnswerDTO>
    */
   public List<OpenTextAnswerDTO> getUserOpenTextAttemptsForTablesorter(Long sessionUid, Long toolContentId, int page,
    int size, int sorting, String searchStringVote, String searchStringUsername, IUserManagementService userManagementService) {
String sortingOrder;
switch (sorting) {
    case VoteAppConstants.SORT_BY_NAME_ASC:
	sortingOrder = "user.fullname ASC";
	break;
    case VoteAppConstants.SORT_BY_NAME_DESC:
	sortingOrder = "user.fullname DESC";
	break;
    case VoteAppConstants.SORT_BY_DATE_ASC:
	sortingOrder = "attempt.attempt_time ASC";
	break;
    case VoteAppConstants.SORT_BY_DATE_DESC:
	sortingOrder = "attempt.attempt_time DESC";
	break;
    case VoteAppConstants.SORT_BY_ENTRY_ASC:
	sortingOrder = "attempt.userEntry ASC";
	break;
    case VoteAppConstants.SORT_BY_ENTRY_DESC:
	sortingOrder = "attempt.userEntry DESC";
	break;
    case VoteAppConstants.SORT_BY_VISIBLE_ASC:
	sortingOrder = "attempt.visible ASC";
	break;
    case VoteAppConstants.SORT_BY_VISIBLE_DESC:
	sortingOrder = "attempt.visible DESC";
	break;
    default:
	sortingOrder = "user.uid";
}

String[] portraitStrings = userManagementService.getPortraitSQL("user.user_id");

// Basic select for the user records
StringBuilder queryText = new StringBuilder(FIND_USER_OPEN_TEXT_SELECT)
	.append(portraitStrings[0])
	.append(FIND_USER_OPEN_TEXT_FROM);

if (sessionUid != null) {
    queryText.append(FIND_USER_OPEN_TEXT_SESSION_UID_ADD);
} else {
    queryText.append(FIND_USER_OPEN_TEXT_CONTENT_UID_ADD);
}
queryText.append(portraitStrings[1]);

// If filtering by name/entry add a where clause
buildCombinedSearch(searchStringVote, searchStringUsername, queryText);

// Now specify the sort based on the switch statement above.
queryText.append(" ORDER BY " + sortingOrder);

SQLQuery query = getSession().createSQLQuery(queryText.toString());
query.addScalar("userUid", LongType.INSTANCE).addScalar("login", StringType.INSTANCE)
	.addScalar("fullName", StringType.INSTANCE).addScalar("userEntryUid", LongType.INSTANCE)
	.addScalar("userEntry", StringType.INSTANCE).addScalar("attemptTime", TimestampType.INSTANCE)
	.addScalar("visible", BooleanType.INSTANCE).addScalar("portraitId", LongType.INSTANCE)
	.setFirstResult(page * size).setMaxResults(size)
	.setResultTransformer(Transformers.aliasToBean(OpenTextAnswerDTO.class));

if (sessionUid != null) {
    query.setLong("sessionUid", sessionUid);
} else {
    query.setLong("toolContentId", toolContentId);
}

return query.list();
   }
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:78,代码来源:VoteUsrAttemptDAO.java


示例11: getReturnType

import org.hibernate.type.BooleanType; //导入依赖的package包/类
@Override
public Type getReturnType(final Type firstArgumentType, final Mapping mapping) throws QueryException {
	return new BooleanType();
}
 
开发者ID:stickfigure,项目名称:postguice,代码行数:5,代码来源:SimpleFullTextSearchFunction.java


示例12: getReturnType

import org.hibernate.type.BooleanType; //导入依赖的package包/类
@Override
public Type getReturnType(Type firstArgumentType, Mapping mapping) {
    return new BooleanType();
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:5,代码来源:PostgreSQLTrigramFunction.java


示例13: getTypeInternal

import org.hibernate.type.BooleanType; //导入依赖的package包/类
public BooleanType getTypeInternal() {
	return ( BooleanType ) getDataType();
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:4,代码来源:BooleanLiteralNode.java


示例14: getReturnType

import org.hibernate.type.BooleanType; //导入依赖的package包/类
@Override
public Type getReturnType(Type firstArgumentType, Mapping mapping) throws QueryException {
	return BooleanType.INSTANCE;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:5,代码来源:PostgreSQLRegexpOperatorFunction.java


示例15: addScalars

import org.hibernate.type.BooleanType; //导入依赖的package包/类
protected void addScalars(SQLQuery query)
{
	query.addScalar("id", StringType.INSTANCE);
	query.addScalar("parentId", StringType.INSTANCE);
	query.addScalar("partitionkey", IntegerType.INSTANCE);
	query.addScalar("URLName", StringType.INSTANCE);
	query.addScalar("canonicalTag", StringType.INSTANCE);
	query.addScalar("canonicalTagHashcode", StringType.INSTANCE);
	query.addScalar("firstFoundAnchorTextToThisURL", StringType.INSTANCE);
	query.addScalar("contentHashcode", StringType.INSTANCE);
	query.addScalar("depthFromDomainRoot", IntegerType.INSTANCE);
	query.addScalar("externalLink", BooleanType.INSTANCE);
	query.addScalar("externalHostName", StringType.INSTANCE);
	query.addScalar("externalLinksOnThisPage", IntegerType.INSTANCE);
	query.addScalar("externalLinksDifferentDomainsOnThisPage", IntegerType.INSTANCE);
	query.addScalar("foundAtURL", StringType.INSTANCE);
	query.addScalar("foundTimestamp", LongType.INSTANCE);
	query.addScalar("h1", StringType.INSTANCE);
	query.addScalar("h2", StringType.INSTANCE);
	query.addScalar("h3", StringType.INSTANCE);
	query.addScalar("httpStatusCode", IntegerType.INSTANCE);
	query.addScalar("internalLinksOnThisPage", IntegerType.INSTANCE);
	query.addScalar("followLinksToThisPage", LongType.INSTANCE);
	query.addScalar("nofollowLinksToThisPage", LongType.INSTANCE);
	query.addScalar("metaDescription", StringType.INSTANCE);
	query.addScalar("metaRobotsFollow", BooleanType.INSTANCE);
	query.addScalar("metaRobotsIndex", BooleanType.INSTANCE);
	query.addScalar("pageSize", IntegerType.INSTANCE);
	query.addScalar("redirectedToURL", StringType.INSTANCE);
	query.addScalar("responseTime", IntegerType.INSTANCE);
	query.addScalar("timeout", BooleanType.INSTANCE);
	query.addScalar("title", StringType.INSTANCE);
	query.addScalar("duplicateContent", BooleanType.INSTANCE);
	query.addScalar("duplicateMetaDescription", BooleanType.INSTANCE);
	query.addScalar("duplicateTitle", BooleanType.INSTANCE);
	query.addScalar("duplicateH1", BooleanType.INSTANCE);
	query.addScalar("canonicalTagIssue", BooleanType.INSTANCE);
	query.addScalar("headlinesNotInRightOrder", BooleanType.INSTANCE);
	query.addScalar("relNofollow", BooleanType.INSTANCE);
	query.addScalar("qualityScore", ShortType.INSTANCE);
	query.addScalar("facebookLikes", IntegerType.INSTANCE);
	query.addScalar("facebookShares", IntegerType.INSTANCE);
	query.addScalar("differentURLSameAnchor", BooleanType.INSTANCE);
	query.addScalar("googleAnalyticsCodeFound", BooleanType.INSTANCE);
	query.addScalar("newPrice", IntegerType.INSTANCE);
	query.addScalar("oldPrice", IntegerType.INSTANCE);
	query.addScalar("color", StringType.INSTANCE);
	query.addScalar("readingLevel", ShortType.INSTANCE);
	query.addScalar("varietyTopicScore", ShortType.INSTANCE);
	query.addScalar("onPageText", StringType.INSTANCE);
	query.addScalar("qwLocale", ShortType.INSTANCE);
	query.addScalar("relevantImages", BooleanType.INSTANCE);
	query.addScalar("adScripts", ShortType.INSTANCE);
	query.addScalar("normalizedText", StringType.INSTANCE);
	query.addScalar("pageRank", DoubleType.INSTANCE);
	query.addScalar("trailingSlashIssue", BooleanType.INSTANCE);
	query.addScalar("gzipIssue", BooleanType.INSTANCE);
	query.addScalar("externalLinkPower", ShortType.INSTANCE);
	query.addScalar("spamScore", ShortType.INSTANCE);
	query.addScalar("backgroundId", ShortType.INSTANCE);
	query.addScalar("pagination", BooleanType.INSTANCE);
	query.addScalar("dcPrimary", BooleanType.INSTANCE);
	query.addScalar("keywordOrientationShortTerm", BooleanType.INSTANCE);
	query.addScalar("keywordOrientationTwoTerms", BooleanType.INSTANCE);
	query.addScalar("topicKeywordOneTerm", StringType.INSTANCE);
	query.addScalar("topicKeywordTwoTerms", StringType.INSTANCE);
	query.addScalar("topicKeywordThreeTerms", StringType.INSTANCE);
	query.addScalar("normalizedTopicKeywordOneTerm", StringType.INSTANCE);
	query.addScalar("normalizedTopicKeywordTwoTerms", StringType.INSTANCE);
	query.addScalar("normalizedTopicKeywordThreeTerms", StringType.INSTANCE);
	query.addScalar("topicKeywordOneTermWeight", ShortType.INSTANCE);
	query.addScalar("topicKeywordTwoTermsWeight", ShortType.INSTANCE);
	query.addScalar("topicKeywordThreeTermsWeight", ShortType.INSTANCE);
	query.addScalar("changeCode", IntegerType.INSTANCE);
	query.addScalar("overwriteFlag", BooleanType.INSTANCE);
	query.addScalar("protocolRecord", BooleanType.INSTANCE);
	query.addScalar("relevantOnPageText", StringType.INSTANCE);
}
 
开发者ID:bonprix,项目名称:solidsearch-bot,代码行数:79,代码来源:URLManager.java



注:本文中的org.hibernate.type.BooleanType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ObjectStreamClass类代码示例发布时间:2022-05-22
下一篇:
Java DefaultWsdl11Definition类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap