Java 类com.liferay.portal.kernel.util.InfrastructureUtil 实例源码

项目:edemocracia    文件:MailEngine.java   
public static Session getSession(boolean cache) {
    Session session = null;

    try {
        session = MailServiceUtil.getSession();
    }
    catch (SystemException se) {
        if (_log.isWarnEnabled()) {
            _log.warn(se, se);
        }

        session = InfrastructureUtil.getMailSession();
    }

    if (_log.isDebugEnabled()) {
        session.setDebug(true);

        session.getProperties().list(System.out);
    }

    return session;
}
项目:mqtt-liferay-plugins    文件:MqttLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:OEPv2    文件:SSOAppLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:OEPv2    文件:SSOAppServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:OEPv2    文件:SSOAppLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:OEPv2    文件:SSOAppServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:govapps    文件:OGPD_EntityLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:govapps    文件:OGPD_EntityServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:liferaylms-portlet    文件:AuditLoggerLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:liferaylms-portlet    文件:AuditLoggerServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:link-scanner    文件:LinkScannerURLStatusServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:link-scanner    文件:LinkScannerURLStatusLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:mqtt-liferay-plugins    文件:MqttLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:edemocracia    文件:WikiLegisServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:edemocracia    文件:MoveTopicoLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:edemocracia    文件:DashboardLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:edemocracia    文件:DadosForumServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:edemocracia    文件:PriorizacaoServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:edemocracia    文件:GraficosLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:edemocracia    文件:ParticipacaoLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    } catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:edemocracia    文件:GraficosLocalServiceImpl.java   
/**
 * Retorna os usuários por UF
 * 
 * @param companyId
 *            TODO
 * @param pais
 * 
 * @return
 */
@Transactional(readOnly = true)
public Map<String, Integer> getUsuariosPorUf(long companyId, Country pais) {

    long contactClassId = ClassNameLocalServiceUtil.getClassNameId(Contact.class.getName());
    long classId = pais.getCountryId();

    DataSource dataSource = InfrastructureUtil.getDataSource();
    String sql = "select reg.regionCode, count(*) from User_ u join Contact_ c on u.contactId = c.contactId "
            + "left outer join "
            + "Address ad on (c.contactId = ad.classPK and ad.classNameId = ? and ad.countryId = ? and ad.primary_ <> 0) "
            + "left outer join Region reg on (ad.regionId = reg.regionId) where u.companyId = ? "
            + "group by reg.regionCode order by reg.regionCode";

    MappingSqlQuery<UsuarioPorEstado> query = MappingSqlQueryFactoryUtil.getMappingSqlQuery(dataSource, sql, new int[] {
            Types.BIGINT, Types.BIGINT, Types.BIGINT }, new RowMapper<UsuarioPorEstado>() {

        @Override
        public UsuarioPorEstado mapRow(ResultSet rs, int rowNumber) throws SQLException {
            String uf = rs.getString(1);
            if (uf == null)
                uf = "N/D";
            return new UsuarioPorEstado(uf, rs.getInt(2));
        }
    });

    Map<String, Integer> retorno = new LinkedHashMap<String, Integer>();
    for (UsuarioPorEstado entrada : query.execute(contactClassId, classId, companyId)) {
        retorno.put(entrada.getUf(), entrada.getNumero());
    }
    return retorno;
}
项目:edemocracia    文件:GraficosLocalServiceImpl.java   
private Map<String, Integer> buscaQuantidadePorData(long companyId, TimeZone tz, Date inicio, Date fim, String sql) {
    DataSource dataSource = InfrastructureUtil.getDataSource();

    // Corrige as datas de início e fim
    Calendar cal = Calendar.getInstance(tz);
    cal.setTime(inicio);
    inicio = CalendarUtil.getGTDate(cal);
    cal.setTime(fim);
    fim = CalendarUtil.getLTDate(cal);

    Map<String, Integer> retorno = new LinkedHashMap<String, Integer>();

    MappingSqlQuery<Date> mensagens = MappingSqlQueryFactoryUtil.getMappingSqlQuery(dataSource, sql, new int[] {
            Types.TIMESTAMP, Types.TIMESTAMP, Types.BIGINT }, new RowMapper<Date>() {

        @Override
        public Date mapRow(ResultSet rs, int rowNumber) throws SQLException {
            return rs.getTimestamp(1);
        }
    });

    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
    sdf.setTimeZone(tz);
    for (Date data : mensagens.execute(inicio, fim, companyId)) {
        String dia = sdf.format(data);
        if (!retorno.containsKey(dia))
            retorno.put(dia, 1);
        else
            retorno.put(dia, retorno.get(dia) + 1);
    }

    return retorno;
}
项目:xipi    文件:InfrastructureServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query to perform
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:xipi    文件:InfrastructureServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query to perform
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:liferay-document-and-media-treeview    文件:EnhancedDLAppServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:liferay-document-and-media-treeview    文件:EnhancedJournalAppServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:hr-portal    文件:WebArticleHelperLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:hr-portal    文件:WebArticleHelperServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:hr-portal    文件:WebArticleHelperLocalServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:hr-portal    文件:WebArticleHelperServiceBaseImpl.java   
/**
 * Performs an SQL query.
 *
 * @param sql the sql query
 */
protected void runSQL(String sql) throws SystemException {
    try {
        DataSource dataSource = InfrastructureUtil.getDataSource();

        SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
                sql, new int[0]);

        sqlUpdate.update();
    }
    catch (Exception e) {
        throw new SystemException(e);
    }
}
项目:latch-plugin-liferay    文件:UserLatchRepository.java   
private QueryRunner createRunner(){
    final DataSource dataSource = InfrastructureUtil.getDataSource();
    return new QueryRunner(dataSource);
}