Codota Logo
StringType.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.hibernate.type.StringType
constructor

Best Java code snippets using org.hibernate.type.StringType.<init> (Showing top 17 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: gocd/gocd

addEntity("mods", Modification.class).
addScalar("pmrPipelineId", new LongType()).
addScalar("pmrPipelineName", new StringType()).
addScalar("materialType", new StringType()).
addScalar("fingerprint", new StringType()).
setParameterList("ids", CollectionUtil.map(relevantToLookedUpMap.keySet(), PipelineId.MAP_ID)).
list();
origin: gocd/gocd

private Map<PipelineId, Set<Long>> relevantToLookedUpDependencyMap(Session session, List<Long> pipelineIds) {
  final int LOOKED_UP_PIPELINE_ID = 2;
  final int RELEVANT_PIPELINE_ID = 0;
  final int RELEVANT_PIPELINE_NAME = 1;
  String pipelineIdsSql = queryExtensions.queryRelevantToLookedUpDependencyMap(pipelineIds);
  SQLQuery pipelineIdsQuery = session.createSQLQuery(pipelineIdsSql);
  pipelineIdsQuery.addScalar("id", new LongType());
  pipelineIdsQuery.addScalar("name", new StringType());
  pipelineIdsQuery.addScalar("lookedUpId", new LongType());
  final List<Object[]> ids = pipelineIdsQuery.list();
  Map<Long, List<PipelineId>> lookedUpToParentMap = new HashMap<>();
  CollectionUtil.CollectionValueMap<Long, PipelineId> lookedUpToRelevantMap = CollectionUtil.collectionValMap(lookedUpToParentMap, new CollectionUtil.ArrayList<>());
  for (Object[] relevantAndLookedUpId : ids) {
    lookedUpToRelevantMap.put((Long) relevantAndLookedUpId[LOOKED_UP_PIPELINE_ID],
        new PipelineId((String) relevantAndLookedUpId[RELEVANT_PIPELINE_NAME], (Long) relevantAndLookedUpId[RELEVANT_PIPELINE_ID]));
  }
  return CollectionUtil.reverse(lookedUpToParentMap);
}
origin: stackoverflow.com

 public List<MessageExtDto> getMessagesForProfile2(Long userProfileId) {
  Query query = getSession().createSQLQuery("  "
      + " select a.*, b.* "
      + " from messageVO AS a "
      + " INNER JOIN ( SELECT max(id) AS id, count(*) AS count FROM messageVO GROUP BY messageConversation_id) as b ON a.id = b.id "
      + " where a.id > 0 "
      + " ")
      .addScalar("id", new LongType())
      .addScalar("message", new StringType())
      ......... your mappings
      .setResultTransformer(Transformers.aliasToBean(MessageExtDto.class));

  List<MessageExtDto> list = query.list();
  return list;
}
origin: openmrs/openmrs-core

/**
 * @see org.openmrs.api.PersonService#getRelationshipTypes(java.lang.String, java.lang.Boolean)
 * @see org.openmrs.api.db.PersonDAO#getRelationshipTypes(java.lang.String, java.lang.Boolean)
 */
@Override
@SuppressWarnings("unchecked")
public List<RelationshipType> getRelationshipTypes(String relationshipTypeName, Boolean preferred) throws DAOException {
  
  Criteria criteria = sessionFactory.getCurrentSession().createCriteria(RelationshipType.class);
  criteria.add(Restrictions.sqlRestriction("CONCAT(a_Is_To_B, CONCAT('/', b_Is_To_A)) like (?)", relationshipTypeName,
    new StringType()));
  
  if (preferred != null) {
    criteria.add(Restrictions.eq("preferred", preferred));
  }
  
  return criteria.list();
}

origin: stackoverflow.com

 if(parameter.getValue() instaceof String){
  query.setParameter(parameter.getKey(), parameter.getValue(), new StringType());
} else if (parameter.getValue() instanceof Integer){
  query.setParameter(parameter.getKey(), parameter.getValue(), new IntegerTypeType())
} else if(...)
origin: stackoverflow.com

 Criteria criteria = session.createCriteria(MyTable.class);
criteria.add( 
 Expression.sql(
  "TIME( {alias}.my_date, 'hh:mm:ss') >= :1", 
  dateRangeMin, 
  new StringType()
 )
);
origin: stackoverflow.com

 Criteria criteria = s.createCriteria(User.class);
criteria.add(
  Expression.sql("userName = ? collate Latin1_General_CS_AS_KS_WS", userName, new StringType())
);
origin: stackoverflow.com

.addScalar("id", new LongType())
 .addScalar("name", new StringType())
origin: stackoverflow.com

Query query = session.createSQLQuery("select AUDIANCE_NO as audianceno , MSG_BODY as messageBody from SMS_MSG_QUEUE").addScalar("audianceno" , new BigDecimalType()).addScalar("messageBody" , new StringType()).setResultTransformer(Transformers.aliasToBean(AudinceInfo.class));
origin: stackoverflow.com

"   store t4 ON (t1.idStore = " + idStore + ")\n " +
"group by t1.id")
.addScalar("goodsName", new StringType())
.addScalar("companyName", new StringType())
.addScalar("amountSum", new IntegerType())
.addScalar("priceOneGoods", new DoubleType())
origin: sakaiproject/sakai

  @SuppressWarnings("unchecked")
  private ExtendedTime        getPubAndX              (final String query, final PublishedAssessmentIfc pub, final String secondParam, final String secondParamValue) {
    try{
      HibernateCallback hcb = (Session s) -> {
        Query q = s.getNamedQuery(query);
        q.setParameter(PUBLISHED_ID, pub, new ManyToOneType(null, "org.sakaiproject.tool.assessment.data.dao.assessment.PublishedAssessmentData"));
        q.setParameter(secondParam, secondParamValue, new StringType());
        return q.uniqueResult();
      };

      return (ExtendedTime) getHibernateTemplate().execute(hcb);
    } catch (DataAccessException e) {
      log.error("Failed to get extended time for pub: " + pub.getPublishedAssessmentId() + " and user/group: " + secondParamValue, e);
      return null;
    }
  }
}
origin: org.sakaiproject.samigo/samigo-services

  @SuppressWarnings("unchecked")
  private ExtendedTime        getPubAndX              (final String query, final PublishedAssessmentIfc pub, final String secondParam, final String secondParamValue) {
    try{
      HibernateCallback hcb = (Session s) -> {
        Query q = s.getNamedQuery(query);
        q.setParameter(PUBLISHED_ID, pub, new ManyToOneType(null, "org.sakaiproject.tool.assessment.data.dao.assessment.PublishedAssessmentData"));
        q.setParameter(secondParam, secondParamValue, new StringType());
        return q.uniqueResult();
      };

      return (ExtendedTime) getHibernateTemplate().execute(hcb);
    } catch (DataAccessException e) {
      log.error("Failed to get extended time for pub: " + pub.getPublishedAssessmentId() + " and user/group: " + secondParamValue, e);
      return null;
    }
  }
}
origin: OpenNMS/opennms

private void addCriteriaForSiteStatusView(OnmsCriteria criteria, String statusViewName, String statusSite, String rowLabel) {
  View view = m_siteStatusViewConfigDao.getView(statusViewName);
  RowDef rowDef = getRowDef(view, rowLabel);
  Set<String> categoryNames = getCategoryNamesForRowDef(rowDef);
  
  addCriteriaForCategories(criteria, categoryNames.toArray(new String[categoryNames.size()]));
  
  String sql = "{alias}.nodeId in (select nodeId from assets where " + view.getColumnName() + " = ?)";
  criteria.add(Restrictions.sqlRestriction(sql, statusSite, new StringType()));
}

origin: io.robe/robe-hibernate

    new String[]{alias}, new Type[]{new StringType()}), alias));
if (searchFrom.localId().isEmpty()) {
  projectionList.add(Projections.property(field.getName()), field.getName());
origin: org.opennms/opennms-web-api

private void addCriteriaForSiteStatusView(OnmsCriteria criteria, String statusViewName, String statusSite, String rowLabel) {
  View view = m_siteStatusViewConfigDao.getView(statusViewName);
  RowDef rowDef = getRowDef(view, rowLabel);
  Set<String> categoryNames = getCategoryNamesForRowDef(rowDef);
  
  addCriteriaForCategories(criteria, categoryNames.toArray(new String[categoryNames.size()]));
  
  String sql = "{alias}.nodeId in (select nodeId from assets where " + view.getColumnName() + " = ?)";
  criteria.add(Restrictions.sqlRestriction(sql, statusSite, new StringType()));
}

origin: OpenNMS/opennms

@Override
public void visitSql(final SqlRestriction restriction) {
  if (restriction.getParameters() != null && restriction.getParameters().length > 0) {
    // Map our {@link Type} enum values to {@link org.hibernate.type.Type} equivalents 
    org.hibernate.type.Type[] types = Arrays.stream(restriction.getTypes()).map(t -> { 
      switch(t) {
      case FLOAT:
        return new FloatType();
      case INTEGER:
        return new IntegerType();
      case LONG:
        return new LongType();
      case STRING:
        return new StringType();
      case TIMESTAMP:
        return new TimestampType();
      default: 
        throw new UnsupportedOperationException("Unsupported type specified in SqlRestriction");
      }
    }).collect(Collectors.toList()).toArray(new org.hibernate.type.Type[restriction.getTypes().length]);
    m_criterions.add(org.hibernate.criterion.Restrictions.sqlRestriction(restriction.getAttribute(), restriction.getParameters(), types));
  } else {
    m_criterions.add(org.hibernate.criterion.Restrictions.sqlRestriction(restriction.getAttribute()));
  }
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public static final NullableType STRING = new StringType();
org.hibernate.typeStringType<init>

Popular methods of StringType

  • nullSafeGet
  • nullSafeSet
  • sqlType
  • getName
  • objectToSQLString
  • set
  • get
  • getJavaTypeDescriptor
  • getSqlTypeDescriptor
  • stringToObject
  • toString
  • toString

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now