Java 类org.hibernate.type.ShortType 实例源码

项目:unitimes    文件:SessionRestore.java   
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);
}
项目:solidsearch-bot    文件:URLRestManager.java   
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);
}
项目:solidsearch-bot    文件:DomainRestManager.java   
private void addScalars(SQLQuery query)
{
    query.addScalar("resultFromTimestampMills", LongType.INSTANCE);
    query.addScalar("qualityScore", ShortType.INSTANCE);
    query.addScalar("totalLinks", LongType.INSTANCE);
    query.addScalar("internalURLs", LongType.INSTANCE);
    query.addScalar("internalNoindexURLs", LongType.INSTANCE);
    query.addScalar("internalIndexURLs", LongType.INSTANCE);
    query.addScalar("externalURLs", LongType.INSTANCE);
    query.addScalar("externalURLsDifferentDomains", LongType.INSTANCE);
    query.addScalar("crawledURLs", LongType.INSTANCE);
    query.addScalar("clientErrorURLs", LongType.INSTANCE);
    query.addScalar("timeoutURLs", LongType.INSTANCE);
    query.addScalar("redirectionURLs", LongType.INSTANCE);
    query.addScalar("serverErrorURLs", LongType.INSTANCE);
    query.addScalar("avgResponseTimeMills", IntegerType.INSTANCE);
    query.addScalar("medianResponseTimeMills", IntegerType.INSTANCE);
    query.addScalar("avgPageSize", LongType.INSTANCE);
    query.addScalar("totalCountOfRelevantKeywords", LongType.INSTANCE);
    query.addScalar("totalCountOfKeywords", LongType.INSTANCE);
    query.addScalar("avgReadingLevel", DoubleType.INSTANCE);
    query.addScalar("domainBrandName", StringType.INSTANCE);
    query.addScalar("homeDocument", StringType.INSTANCE);
}
项目:unitime    文件:SessionRestore.java   
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);
}
项目:solidsearch-bot    文件:ExternalLinkRestManager.java   
private void addScalars(SQLQuery query)
{
    query.addScalar("URLName", StringType.INSTANCE);
    query.addScalar("foundAtURL", StringType.INSTANCE);
    query.addScalar("externalLinkPower", ShortType.INSTANCE);
}
项目:solidsearch-bot    文件:URLManager.java   
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);
}