- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 DaoHibernateImpl 文件,它破坏了我的应用程序。下面是它的代码及其 xml。
public class OfferBankDaoHibernateImpl extends GenericDaoHibernateImpl<OfferBank, Long> implements OfferBankDao {
static Logger log = Logger.getLogger(OfferBankDaoHibernateImpl.class);
private ResourceManager rMgr = new ResourceManager(this);
public List<OfferBank> findOfferBankByName(String offerBankNm) throws AppException {
List<OfferBank> offerBanks = new ArrayList<OfferBank>();
try {
// offerBanks =
// sessionFactory.getCurrentSession().createCriteria(OfferBank.class)
// .add( Restrictions.eq("offerBankNm", offerBankNm))
// .list();
offerBanks = sessionFactory.getCurrentSession().createQuery("from OfferBank ob where ob.offerBankNm = '" + offerBankNm + "'").list();
} catch (GenericJDBCException e) {
log.error(e.getMessage(), e);
throw new AppException(e.getMessage(), e);
} catch (HibernateException e) {
log.error(e.getMessage(), e);
throw new AppException(e.getMessage(), e);
}
return offerBanks;
}
public Object[] getOfferBanks(List<String> offerBankTypes, int startPos, int endPos, List<Long> statusIds) {
int totalRowCount = 1000000;
try {
if (endPos == 0) {
endPos = totalRowCount;
}
String dataSql = rMgr.get("sql.offer_bank_get_banks");
dataSql += " " + rMgr.get("sql.offer_bank_get_banks_types_where");
if (!statusIds.isEmpty()) {
dataSql += " " + rMgr.get("sql.offer_bank_get_banks_status_where");
}
dataSql += " " + rMgr.get("sql.offer_banks_get_banks_group_by");
log.debug("query : " + dataSql);
SQLQuery dataQuery = this.sessionFactory.getCurrentSession().createSQLQuery(dataSql);
if (!statusIds.isEmpty()) {
dataQuery.setParameterList("offerBankStatusIds", statusIds);
}
dataQuery.setParameterList("offerBankTypes", offerBankTypes).setParameter("start", startPos).setParameter("end", endPos);
List offerBankList = dataQuery.list();
return makeOfferBankTO(offerBankList);
} catch (RuntimeException e) {
log.error("Error getOfferBanks(List<Long> offerBankTypes ,int startPos, int endPos, List<Long> statusIds)");
throw e;
}
}
public Object[] getOfferBanksByBanner(List<String> offerBankTypes, int startPos, int endPos, List<Long> statusIds) {
int totalRowCount = 1000000;
try {
if (endPos == 0) {
endPos = totalRowCount;
}
String dataSql = rMgr.get("sql.offer_bank_get_banks_by_banner");
dataSql += " " + rMgr.get("sql.offer_bank_get_banks_types_where");
if (!statusIds.isEmpty()) {
dataSql += " " + rMgr.get("sql.offer_bank_get_banks_status_where");
}
dataSql += " " + rMgr.get("sql.offer_banks_get_banks_by_banner_group_by");
log.debug("query : " + dataSql);
SQLQuery dataQuery = this.sessionFactory.getCurrentSession().createSQLQuery(dataSql);
if (!statusIds.isEmpty()) {
dataQuery.setParameterList("offerBankStatusIds", statusIds);
}
dataQuery.setParameterList("offerBankTypes", offerBankTypes).setParameter("start", startPos).setParameter("end", endPos);
List offerBankList = dataQuery.list();
return makeOfferBankTO(offerBankList);
} catch (RuntimeException e) {
log.error("Error getOfferBanksByBanner(List<Long> offerBankTypes ,int startPos, int endPos, List<Long> statusIds)");
throw e;
}
}
public Object[] getOfferBankById(List<Long> offerBankIds) {
int startPos = 1;
int endPos = 100000;
String dataSql = rMgr.get("sql.offer_bank_get_banks");
dataSql += " " + rMgr.get("sql.offer_bank_get_banks_ids_where");
dataSql += " " + rMgr.get("sql.offer_banks_get_banks_group_by");
log.debug("sql= " + dataSql);
SQLQuery dataQuery = this.sessionFactory.getCurrentSession().createSQLQuery(dataSql);
dataQuery.setParameterList("offerBankIds", offerBankIds).setParameter("start", startPos).setParameter("end", endPos);
List offerBankList = dataQuery.list();
return makeOfferBankTO(offerBankList);
}
private Object[] makeOfferBankTO(List offerBankList) {
int totalRowCount = 0;
List<OfferBankTO> offerBankTOs = new ArrayList<OfferBankTO>();
Iterator iter = offerBankList.iterator();
while (iter.hasNext()) {
Object[] row = (Object[]) iter.next();
OfferBankTO ob = new OfferBankTO();
ob.setOfferBankId(((BigDecimal) row[0]).longValue());
ob.setPromotionalPeriodId(((BigDecimal) row[1]).longValue());
ob.setOfferBankName(row[2].toString());
ob.setOfferBankStatusDesc(row[3].toString());
if (row[4] != null) {
ob.setStartDate(DateFormats.dateFmt.format((Date) row[4]));
}
if (row[5] != null) {
ob.setEndDate(DateFormats.dateFmt.format((Date) row[5]));
}
ob.setOfferBankTypeDesc(row[6].toString());
ob.setOfferBankTypeCd(row[7].toString());
ob.setPromotionalPeriodNm(row[8].toString());
ob.setTotalCount(((Integer) row[9]).intValue());
ob.setEditingCount(((Integer) row[10]).intValue());
ob.setFailedDeactiveCount(((Integer) row[11]).intValue());
ob.setFailedProductionCount(((Integer) row[12]).intValue());
ob.setFailedPreviewCount(((Integer) row[13]).intValue());
ob.setLoadedCount(((Integer) row[14]).intValue());
ob.setPendingCount(((Integer) row[15]).intValue());
ob.setParkedCount(((Integer) row[16]).intValue());
ob.setSuccessDeactivatedCount(((Integer) row[17]).intValue());
ob.setSuccessLoadedProdCount(((Integer) row[18]).intValue());
ob.setSuccessLoadedPreviewCount(((Integer) row[19]).intValue());
ob.setTotalPendingCount(((Integer) row[20]).intValue());
ob.setTotalFailedCount(((Integer) row[21]).intValue());
totalRowCount = ((Integer) row[22]).intValue();
if (row[24] != null)
ob.setMaxOfferEffectiveEndDt(DateFormats.dateFmt.format((Date) row[24]));
if (row[25] != null)
ob.setMinOfferEffectiveStartDt(DateFormats.dateFmt.format((Date) row[25]));
ob.setEndedCount(((Integer) row[26]).intValue());
ob.setCopientDelayCount(((Integer) row[27]).intValue());
ob.setRejectedCount(((Integer) row[28]).intValue());
ob.setProcessingCount(((Integer) row[29]).intValue());
if (row.length > 30) {
if (row[30] != null) {
ob.setRegionId(row[30].toString());
}
if (row[31] != null) {
ob.setRegionNm(row[31].toString());
}
}
offerBankTOs.add(ob);
}
return new Object[] { totalRowCount, offerBankTOs };
}
public Object[] getBankTypes() {
List<OfferBankTypeTO> offerBankTypes = new ArrayList<OfferBankTypeTO>();
try {
String sql = rMgr.get("sql.offer_bank_types");
SQLQuery query = this.sessionFactory.getCurrentSession().createSQLQuery(sql);
List typeList = query.list();
Iterator iter = typeList.iterator();
while (iter.hasNext()) {
Object[] row = (Object[]) iter.next();
OfferBankTypeTO type = new OfferBankTypeTO();
type.setOfferBankTypeCd(row[0].toString());
type.setOfferBankTypeDesc(row[1].toString());
offerBankTypes.add(type);
}
} catch (RuntimeException e) {
log.error("Error List<OfferBankType> getBankTypes()");
throw e;
}
return new Object[] { offerBankTypes };
}
public void updateOfferBank(OfferBank offerBank, Context ctx) {
String user = (ctx != null && ((UserContext) ctx).getUserName() != null && ((UserContext) ctx).getUserName().length() > 0) ? ((UserContext) ctx)
.getUserName() : SharedMessages.getString("user.default");
offerBank.setLastUpdtTs(new Date(System.currentTimeMillis()));
offerBank.setLastUpdtUserId(user);
this.makePersistent(offerBank);
}
public OfferBank addOfferBank(OfferBank offerBank, Context ctx) {
String user = (ctx != null && ((UserContext) ctx).getUserName() != null && ((UserContext) ctx).getUserName().length() > 0) ? ((UserContext) ctx)
.getUserName() : SharedMessages.getString("user.default");
Date now = new Date(System.currentTimeMillis());
offerBank.setLastUpdtTs(now);
offerBank.setLastUpdtUserId(user);
offerBank.setCreationUserId(user);
offerBank.setCreationTs(now);
return this.insert(offerBank);
}
public int updateCurrentBankStatus(OfferBank offerBank, Context ctx) {
String sql = rMgr.get("sql.update_current_bank_status");
SQLQuery query = this.sessionFactory.getCurrentSession().createSQLQuery(sql);
query.setParameter("offer_bank_id", offerBank.getOfferBankId());
return query.executeUpdate();
}
public void insertBankStatus(OfferBank offerBank, short newStatusId, Context ctx) {
String user = (ctx != null && ((UserContext) ctx).getUserName() != null && ((UserContext) ctx).getUserName().length() > 0) ? ((UserContext) ctx)
.getUserName() : SharedMessages.getString("user.default");
OfferBankStatus offerBankStatus = new OfferBankStatus();
OfferBankStatusId offerBankStatusId = new OfferBankStatusId();
Date now = new Date(System.currentTimeMillis());
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
offerBankStatusId.setOfferBankId(offerBank.getOfferBankId());
offerBankStatusId.setEffectiveStartDt(now);
offerBankStatus.setId(offerBankStatusId);
offerBankStatus.setCreationTs(now);
offerBankStatus.setCreationUserId(user);
offerBankStatus.setEffectiveEndDt(null);
offerBankStatus.setLastUpdtTs(now);
offerBankStatus.setLastUpdtUserId(user);
this.sessionFactory.getCurrentSession().save(offerBankStatus);
}
/*public void addOfferBankRegions(List<OfferBankCluster> obRegionList, Context ctx) {
String user = (ctx != null && ((UserContext) ctx).getUserName() != null && ((UserContext) ctx).getUserName().length() > 0) ? ((UserContext) ctx)
.getUserName() : SharedMessages.getString("user.default");
Date now = new Date(System.currentTimeMillis());
for (OfferBankCluster obc : obRegionList) {
obc.setCreationUserId(user);
obc.setCreationTs(now);
obc.setLastUpdtTs(now);
obc.setLastUpdtUserId(user);
this.sessionFactory.getCurrentSession().save(obc);
}
}*/
}
xml 文件是:
<?xml version="1.0" encoding="UTF-8"?>
<properties>
<sql>
<offer_bank_get_banks>
select * from (
select
ob.offer_bank_id
, ob.promotional_period_id
, ob.offer_bank_nm
, obst.offer_bank_status_type_dsc
, ob.effective_start_dt
, ob.effective_end_dt
, obt.offer_bank_type_dsc
, obt.offer_bank_type_cd
, pp.promotional_period_nm
, SUM(CASE WHEN a.offer_id IS NOT NULL THEN 1 ELSE 0 END) as total_count
, SUM(CASE WHEN a.offer_status_type_cd = 'ED' THEN 1 ELSE 0 END) as editing_count
, SUM(CASE WHEN a.offer_status_type_cd = 'FD' THEN 1 ELSE 0 END) as failed_deactive_count
, SUM(CASE WHEN a.offer_status_type_cd in ('FP', 'FI') THEN 1 ELSE 0 END) as failed_production_count
, SUM(CASE WHEN a.offer_status_type_cd = 'FV' THEN 1 ELSE 0 END) as failed_preview_count
, SUM(CASE WHEN a.offer_status_type_cd = 'LD' THEN 1 ELSE 0 END) as loaded_count
, SUM(CASE WHEN a.offer_status_type_cd in ('PE', 'PS') THEN 1 ELSE 0 END) as pending_count
, SUM(CASE WHEN a.offer_status_type_cd = 'PK' THEN 1 ELSE 0 END) as parked_count
, SUM(CASE WHEN a.offer_status_type_cd = 'SD' THEN 1 ELSE 0 END) as successfully_deactivated_count
, SUM(CASE WHEN a.offer_status_type_cd in ('SP','PI') THEN 1 ELSE 0 END) as successfully_loaded_to_prod_count
, SUM(CASE WHEN a.offer_status_type_cd = 'SV' THEN 1 ELSE 0 END) as successfully_loaded_to_preview_count
, SUM(CASE WHEN a.offer_status_type_cd in ('LD','PE','PS') THEN 1 ELSE 0 END) as total_pending_count
, SUM(CASE WHEN a.offer_status_type_cd in ('FD','FP','FV','FR','FI') THEN 1 ELSE 0 END) as failed_count
, COUNT(1) OVER(PARTITION BY 1) as total_rows
, ROW_NUMBER() OVER (ORDER BY ob.effective_end_dt desc) as row_nbr
, MAX(a.offer_effective_end_dt)as max_offer_effective_end_dt
, MIN(a.offer_effective_start_dt)as min_offer_effective_start_dt
, SUM(CASE WHEN a.offer_status_type_cd in('AR','SR','SD') THEN 1 ELSE 0 END) as ended_count
, SUM(CASE WHEN a.offer_status_type_cd in('CD') THEN 1 ELSE 0 END) as copient_delay_count
, SUM(CASE WHEN a.offer_status_type_cd in('SR') THEN 1 ELSE 0 END) as rejected_count
, SUM(CASE WHEN a.offer_status_type_cd in('LV', 'GV', 'CD', 'GA', 'GC', 'GD', 'GI', 'GP', 'GR', 'LA', 'LI', 'LP', 'LR', 'LV', 'LE')
THEN 1 ELSE 0 END) as processing_count
from
${sql.database}.offer_bank ob
INNER JOIN ${sql.database}.offer_bank_status obs
ON ob.offer_bank_id = obs.offer_bank_id
INNER JOIN ${sql.database}.offer_bank_status_type obst
ON obs.offer_bank_status_type_cd = obst.offer_bank_status_type_cd
INNER JOIN ${sql.database}.promotional_period pp
ON ob.promotional_period_id = pp.promotional_period_id
INNER JOIN ${sql.database}.offer_bank_type obt
ON ob.offer_bank_type_cd = obt.offer_bank_type_cd
LEFT OUTER JOIN
(Select
o.offer_id
, o.offer_bank_id
, ost.offer_status_type_cd
, o.offer_effective_end_dt
, o.offer_effective_start_dt
from
${sql.database}.offer o
INNER JOIN ${sql.database}.offer_status os
ON o.offer_id = os.offer_id
INNER JOIN ${sql.database}.offer_status_type ost
ON os.offer_status_type_cd = ost.offer_status_type_cd
AND os.effective_end_dt is null
) a
ON ob.offer_bank_id = a.offer_bank_id
where
obs.effective_end_dt is null
</offer_bank_get_banks>
错误堆栈为:
20:52:16,069 ERROR JDBCExceptionReporter:101 - ORA-00972: identifier is too long
20:52:16,070 ERROR OfferBankDaoHibernateImpl:77 - Error getOfferBanks(List<Long> offerBankTypes ,int startPos, int endPos, List<Long> statusIds)
Jul 19, 2013 8:52:16 PM org.restlet.resource.UniformResource doCatch
WARNING: Exception or error caught in resource
我的代码在 OfferBankDaoHibernateImpl 处被破坏。对我来说,方法 getOfferBanks(List OfferBankTypes ,int startPos, int endPos, List statusIds) 正在崩溃。如果有人遇到过类似的情况,会有所帮助吗?
最佳答案
ORA-00972: 标识符太长
告诉您问题是什么。 max length of an identifier is 30 characters在 Oracle 中,您有几个长度超过 30 个字符的别名。例如,successively_loaded_to_prod_count
为 33 个字符。
关于Java/J2EE 内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17755674/
谁能解释一下 Server.MapPath(".")、Server.MapPath("~")、Server.MapPath(@"之间的区别\") 和 Server.MapPath("/")? 最佳答案
我不知道,为什么我们要使用 Server.UrlEncode() & Server.UrlDecode()?!在 QueryString 中我们看到 URL 中的任何内容,那么为什么我们要对它们进行编
我已经通过 WHM 在我的一个域上安装了 ssl 证书。网站正在使用 https://xyz.com . 但是它不适用于 https://www.xyz.com .我已经检查了证书,它也适用于 www
我已经使用 WMI 检测操作系统上是否存在防病毒软件,itz 正常工作并通过使用命名空间向我显示防病毒信息,例如 win xp 和 window7 上的名称和实例 ID:\root\SecurityC
我们有 hive 0.10 版本,我们想知道是否应该使用 Hive Server 1 或 Hive Server2。另一个问题是连接到在端口 10000 上运行的 Hive 服务器,使用 3rd 方工
我想在 C++ 中使用 Windows Server API 设置一个 HTTPS 服务器,我使用了示例代码,它在 HTTP 上工作正常,但我就是不能让它在 HTTPS 上工作。 (我不想要客户端 S
我写了一个非常基本的类来发送电子邮件。我用 smtp 服务器对其进行了测试,它工作正常,但是当我尝试使用我公司的交换服务器时,它给出了这个异常: SMTP 服务器需要安全连接或客户端未通过身份验证。服
我的应用程序包含一个“网关”DataSnap REST 服务器,它是所有客户端的第一个访问点。根据客户端在请求中传递的用户名(基本身份验证),请求需要重定向到另一个 DataSnap 服务器。我的问题
我有一个 Tomcat 服务器和一个 Glassfish4 服务器。我的 Servlet 在 Tomcat 服务器上启动得很好,但在 Glassfish4 服务器上给我一个“HTTP Status 4
我在 vmware 上创建了一个 ubuntu 服务器。我用它作为文件服务器。如果我通过托管虚拟机的计算机进行连接,则可以访问它。我无法从同一网络上的其他计算机执行此操作。提前致谢! 最佳答案 首先确
如何重启 Rails 服务器?我从 开始 rails server -d 所以服务器是分离的 我知道的唯一方法就是去做ps 辅助 | grep rails 并 kill -9关于过程#但是像这样杀死进
我实际上正在尝试找到编写一个简单的 XMPP 服务器的最佳方法,或者找到一个占用空间非常小的服务器。我只关心XMPP的核心功能(状态、消息传递、群组消息传递)。目前还在学习 XMPP 协议(proto
我实际上正在尝试找到编写简单 XMPP 服务器的最佳方法,或者找到一个占用空间非常小的方法。我只关心 XMPP 的核心功能(统计、消息、组消息)。目前也在学习 XMPP 协议(protocol),所以
我们正在尝试从 Java JAX-RS 适配器访问 SOAP 1.1 Web 服务。 我们正在使用从 WSDL 生成的 SOAP 客户端。 但是当解码 SOAP 故障时,我们得到以下异常: ... C
目前,我和许多其他人正在多个平台(Windows、OS X 和可能的 Linux)上使用 Python HTTP 服务器。我们正在使用 Python HTTP 服务器来测试 JavaScript 游戏
我有一个连续运行的服务器程序(C#/.NET 2.0 on Linux with mono),我想从 PHP 脚本连接到它以在网站上显示状态信息。 目的是创建一个(某种)实时浏览器游戏(无 Flash
所以我有一个单页客户端应用程序。 正常流程: 应用程序 -> OAuth2 服务器 -> 应用程序 我们有自己的 OAuth2 服务器,因此人们可以登录应用程序并获取与用户实体关联的 access_t
我们刚刚将测试 Web 服务器从 Server 2008 升级到 Server 2012 R2。我们有一个部署我们网站的批处理脚本。当它将站点推送到服务器时,它现在失败了。奇怪的是,我可以使用相同的发
建议一些加载SpagoBI服务器的方法,我尝试了所有方法来解析spagobi服务器。在 Catalina 中,错误是 - * SEVERE: Unable to process Jar entry [
当我们点击应用程序服务器(apache tomcat)时,它会创建一个线程来处理我们的请求并与 tomcat 连接,建立连接,tomcat 创建另一个线程来处理请求并将其传递给连接,连接线程将其传递给
我是一名优秀的程序员,十分优秀!