Example usage for org.hibernate.type StandardBasicTypes BIG_INTEGER

List of usage examples for org.hibernate.type StandardBasicTypes BIG_INTEGER

Introduction

In this page you can find the example usage for org.hibernate.type StandardBasicTypes BIG_INTEGER.

Prototype

BigIntegerType BIG_INTEGER

To view the source code for org.hibernate.type StandardBasicTypes BIG_INTEGER.

Click Source Link

Document

The standard Hibernate type for mapping java.math.BigInteger to JDBC java.sql.Types#NUMERIC NUMERIC .

Usage

From source file:ejer3.E2anadirNueva.java

Long empresasGetNext() {
    Query query = sese.createSQLQuery("select emp_auto.nextval as num from dual").addScalar("num",
            StandardBasicTypes.BIG_INTEGER);

    return ((BigInteger) query.uniqueResult()).longValue();
}

From source file:ejer3.E3anadirNueva.java

Long ingenierosGetNext() {
    Query query = sese.createSQLQuery("select ing_auto.nextval as num from dual").addScalar("num",
            StandardBasicTypes.BIG_INTEGER);

    return ((BigInteger) query.uniqueResult()).longValue();
}

From source file:ejer3.E4anadirNueva.java

Long proyectosGetNext() {
    Query query = sese.createSQLQuery("select pro_auto.nextval as num from dual").addScalar("num",
            StandardBasicTypes.BIG_INTEGER);

    return ((BigInteger) query.uniqueResult()).longValue();
}

From source file:jp.xet.baseunits.hibernate.PersistentMillisecDuration.java

License:Apache License

/**
 * ??
 * 
 * @since 1.2
 */
public PersistentMillisecDuration() {
    super(StandardBasicTypes.BIG_INTEGER);
}

From source file:jp.xet.baseunits.hibernate.PersistentSecDuration.java

License:Apache License

/**
 * ??
 * 
 * @since 1.2
 */
public PersistentSecDuration() {
    super(StandardBasicTypes.BIG_INTEGER);
}

From source file:org.jadira.usertype.spi.shared.AbstractBigIntegerColumnMapper.java

License:Apache License

public final BigIntegerType getHibernateType() {
    return StandardBasicTypes.BIG_INTEGER;
}

From source file:org.joda.time.contrib.hibernate.PersistentDurationAsMilliseconds.java

License:Apache License

public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner)
        throws HibernateException, SQLException {
    BigInteger b = (BigInteger) StandardBasicTypes.BIG_INTEGER.nullSafeGet(rs, names[0], session, owner);
    if (b == null) {
        return null;
    }//from   ww w. ja  va 2  s.c  o m

    return new Duration(b.longValue());
}

From source file:org.joda.time.contrib.hibernate.PersistentDurationAsMilliseconds.java

License:Apache License

public void nullSafeSet(PreparedStatement statement, Object value, int index, SessionImplementor session)
        throws HibernateException, SQLException {
    if (value == null) {
        StandardBasicTypes.BIG_INTEGER.nullSafeSet(statement, null, index, session);
    } else {//from www. j ava  2  s.c  om
        StandardBasicTypes.BIG_INTEGER.nullSafeSet(statement, BigInteger.valueOf((Long) value), index, session);
    }
}

From source file:org.jtalks.poulpe.model.dao.hibernate.UserHibernateDao.java

License:Open Source License

/**
 * {@inheritDoc}/*ww w  .  j a v a 2 s.c  o m*/
 */
@Override
public List<PoulpeUser> getUsersInGroups(List<Group> groups) {
    Query query = session().getNamedQuery("findBannedUsers");

    ArrayList groupsIds = new ArrayList();
    for (Group group : groups) {
        groupsIds.add(new BigInteger(group.getId() + ""));
    }
    query.setParameterList("bannedGroups", groupsIds, StandardBasicTypes.BIG_INTEGER);
    //noinspection unchecked
    return query.list();
}

From source file:org.jtalks.poulpe.model.dao.hibernate.UserHibernateDao.java

License:Open Source License

/**
 * {@inheritDoc}/*  w w  w. ja  v  a 2s  .com*/
 */
@Override
public List<PoulpeUser> findUsersNotInGroups(String availableFilterText, List<Group> groups,
        Pagination paginate) {
    availableFilterText = SqlLikeEscaper.escapeControlCharacters(availableFilterText);
    Query query = session().getNamedQuery("findUnbannedUsersByLikeUsername");
    query.setString("username", MessageFormat.format(FORMAT, availableFilterText));

    ArrayList groupsIds = new ArrayList();
    for (Group group : groups) {
        groupsIds.add(new BigInteger(group.getId() + ""));
    }

    query.setParameterList("bannedGroups", groupsIds, StandardBasicTypes.BIG_INTEGER);
    paginate.addPagination(query);
    //noinspection unchecked
    return query.list();
}