List of usage examples for java.lang Number intValue
public abstract int intValue();
From source file:org.openmrs.module.accounting.api.db.AccountingDAO.java
public int countListBudgets(boolean includeRetired) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Budget.class); Number rs = (Number) criteria.setProjection(Projections.rowCount()).uniqueResult(); return rs != null ? rs.intValue() : 0; }
From source file:org.openmrs.module.accounting.api.db.AccountingDAO.java
public int countListPayments() { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Payment.class); criteria.addOrder(Order.desc("paymentDate")); Number rs = (Number) criteria.setProjection(Projections.rowCount()).uniqueResult(); return rs != null ? rs.intValue() : 0; }
From source file:org.openmrs.module.accounting.api.db.AccountingDAO.java
public int countListPaymentsByAccount(Account account) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Payment.class); criteria.add(Restrictions.eq("account", account)); Number rs = (Number) criteria.setProjection(Projections.rowCount()).uniqueResult(); return rs != null ? rs.intValue() : 0; }
From source file:org.openmrs.module.accounting.api.db.AccountingDAO.java
@SuppressWarnings("unchecked") public int countListIncomeReceipt(boolean includeVoided) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(IncomeReceipt.class); if (!includeVoided) criteria.add(Restrictions.eq("voided", false)); Number rs = (Number) criteria.setProjection(Projections.rowCount()).uniqueResult(); return rs != null ? rs.intValue() : 0; }
From source file:com.prowidesoftware.swift.model.field.Field50F.java
/** * Set the component2 from a Number object. * <br />//from w w w . jav a2s . c o m * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent2(String) * method. * * @see #setComponent2(String) * * @param component2 the Number with the component2 content to set */ public Field50F setComponent2(java.lang.Number component2) { if (component2 != null) { setComponent(2, "" + component2.intValue()); } return this; }
From source file:com.prowidesoftware.swift.model.field.Field50F.java
/** * Set the component4 from a Number object. * <br />// w ww .j ava2 s . co m * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent4(String) * method. * * @see #setComponent4(String) * * @param component4 the Number with the component4 content to set */ public Field50F setComponent4(java.lang.Number component4) { if (component4 != null) { setComponent(4, "" + component4.intValue()); } return this; }
From source file:com.prowidesoftware.swift.model.field.Field50F.java
/** * Set the component6 from a Number object. * <br />/* w w w. j a va 2s .c om*/ * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent6(String) * method. * * @see #setComponent6(String) * * @param component6 the Number with the component6 content to set */ public Field50F setComponent6(java.lang.Number component6) { if (component6 != null) { setComponent(6, "" + component6.intValue()); } return this; }
From source file:com.prowidesoftware.swift.model.field.Field50F.java
/** * Set the component8 from a Number object. * <br />//from w w w . j ava 2 s . c o m * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent8(String) * method. * * @see #setComponent8(String) * * @param component8 the Number with the component8 content to set */ public Field50F setComponent8(java.lang.Number component8) { if (component8 != null) { setComponent(8, "" + component8.intValue()); } return this; }
From source file:com.wandrell.pattern.repository.spring.SpringJdbcRepository.java
/** * Adds an entity to the repository, or updates it if it already exists. * <p>/*from ww w . j a v a 2 s . co m*/ * Note that both the {@code add} and the {@link #update(PersistenceEntity) * update} methods work the same. If the entity does not exist it will be * added, but if it already exists then it will be updated. * <p> * If the entity is to be updated, then the update query received on the * constructor will be used. * <p> * If it is inserted, a query generated from the data received by the * constructor will be used. * * @param entity * the entity to add */ @Override public final void add(final V entity) { final SqlParameterSource parameterSource; // Parameters source final Number newKey; // Key assigned to the new // entity checkNotNull(entity, "Received a null pointer as the entity"); parameterSource = new BeanPropertySqlParameterSource(entity); if ((entity.getId() == null) || (entity.getId() < 0)) { // No ID has been assigned // It is a new entity newKey = getInsertHandler().executeAndReturnKey(parameterSource); entity.setId(newKey.intValue()); } else { // ID already assigned // It is an existing entity getTemplate().update(getUpdateQueryTemplate(), parameterSource); } }
From source file:com.prowidesoftware.swift.model.field.Field259.java
/** * Set the component2 from a Number object. * <br />//from www . j a va 2 s .c o m * <em>If the component being set is a fixed length number, the argument will not be * padded.</em> It is recommended for these cases to use the setComponent2(String) * method. * * @see #setComponent2(String) * * @param component2 the Number with the component2 content to set */ public Field259 setComponent2(java.lang.Number component2) { if (component2 != null) { setComponent(2, "" + component2.intValue()); } return this; }