- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我将 Spring 与 hibernate、firebird 一起使用,当我作为应用程序运行时,出现此错误。如果我连接到mysql它工作正常。哪里错了?非常感谢。这是一个本地服务器会计软件桌面,我需要这些数据来导出另一种格式(对不起我的英语学习)。
causa raíz
org.hibernate.exception.SQLGrammarException: could not prepare statement
org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123)
org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:188)
org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:159)
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1858)
INFO: HHH000397: Using ASTQueryTranslatorFactory
Hibernate: create table HT_empresas (CLAVE numeric(18,0) not null, hib_sess_id CHAR(36))
oct 23, 2014 2:58:26 PM org.springframework.web.servlet.handler.AbstractHandlerMethodMapping registerHandlerMethod
Información: Mapped "{[/],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.atorresbr.springapp.EmpresasController.list(org.springframework.ui.Model)
oct 23, 2014 2:58:27 PM org.springframework.orm.hibernate4.HibernateTransactionManager afterPropertiesSet
Información: Using DataSource [org.apache.commons.dbcp.BasicDataSource@1e3ff47] of Hibernate SessionFactory for HibernateTransactionManager
oct 23, 2014 2:58:27 PM org.springframework.web.servlet.FrameworkServlet initServletBean
Información: FrameworkServlet 'apliconta2web': initialization completed in 3840 ms
oct 23, 2014 2:58:27 PM org.apache.coyote.AbstractProtocol start
Información: Starting ProtocolHandler ["http-bio-8080"]
oct 23, 2014 2:58:27 PM org.apache.coyote.AbstractProtocol start
Información: Starting ProtocolHandler ["ajp-bio-8009"]
oct 23, 2014 2:58:27 PM org.apache.catalina.startup.Catalina start
Información: Server startup in 7945 ms
Hibernate: select empresas0_.CLAVE as CLAVE1_0_, empresas0_.ACT_CONTRASE as ACT2_0_, empresas0_.ADMON as ADMON3_0_, empresas0_.BALANCE as BALANCE4_0_, empresas0_.BALANCE_UE as BALANCE5_0_, empresas0_.COBROS as COBROS6_0_, empresas0_.CODPAIS as CODPAIS7_0_, empresas0_.CODPOSTAL as CODPOSTA8_0_, empresas0_.CONTACTO as CONTACTO9_0_, empresas0_.CONTRASE as CONTRAS10_0_, empresas0_.COOPERA as COOPERA11_0_, empresas0_.CORREO as CORREO12_0_, empresas0_.CRITERIOCAJA as CRITERI13_0_, empresas0_.DNICIF as DNICIF14_0_, empresas0_.DOC3W_AUTOGESTION as DOC15_0_, empresas0_.DOC3W_REFURL as DOC16_0_, empresas0_.EJERCICIO as EJERCIC17_0_, empresas0_.E_RETEN as E18_0_, empresas0_.FAX as FAX19_0_, empresas0_.FECHAFIN as FECHAFI20_0_, empresas0_.FECHAINI as FECHAIN21_0_, empresas0_.FECHA_BAJA as FECHA22_0_, empresas0_.FOLIO_R as FOLIO23_0_, empresas0_.GES_DOCU as GES24_0_, empresas0_.GES_PROYECTOS as GES25_0_, empresas0_.HOJA_R as HOJA26_0_, empresas0_.IGIC_IVA as IGIC27_0_, empresas0_.ILOGO as ILOGO28_0_, empresas0_.INUMERO as INUMERO29_0_, empresas0_.LIBRO_R as LIBRO30_0_, empresas0_.MOVILCONTACTO as MOVILCO31_0_, empresas0_.MUNICIPIO as MUNICIP32_0_, empresas0_.NIVEL as NIVEL33_0_, empresas0_.NOMBRE as NOMBRE34_0_, empresas0_.NUMERO as NUMERO35_0_, empresas0_.OBSERVACIONES as OBSERVA36_0_, empresas0_.OCUPADO as OCUPADO37_0_, empresas0_.OTROS_R as OTROS38_0_, empresas0_.PAG_ASIEN as PAG39_0_, empresas0_.PISO as PISO40_0_, empresas0_.PROVINCIA as PROVINC41_0_, empresas0_.PUERTA as PUERTA42_0_, empresas0_.REGCOMPRAS as REGCOMP43_0_, empresas0_.REGMER as REGMER44_0_, empresas0_.REGVENTAS as REGVENT45_0_, empresas0_.SECCION_R as SECCION46_0_, empresas0_.SIGLA as SIGLA47_0_, empresas0_.SUBC_DESP1 as SUBC48_0_, empresas0_.SUBC_DESP2 as SUBC49_0_, empresas0_.SUBC_DESP3 as SUBC50_0_, empresas0_.SUBC_DESP4 as SUBC51_0_, empresas0_.SUBC_DESP7 as SUBC52_0_, empresas0_.SUBC_DESPC1 as SUBC53_0_, empresas0_.SUBC_DESPI1 as SUBC54_0_, empresas0_.SUBC_DESPI2 as SUBC55_0_, empresas0_.SUBC_DESPI3 as SUBC56_0_, empresas0_.SUBC_DESPI4 as SUBC57_0_, empresas0_.SUBC_DESPI5 as SUBC58_0_, empresas0_.SUBC_DESPI6 as SUBC59_0_, empresas0_.SUB_TYPE as SUB60_0_, empresas0_.TELEFONO as TELEFON61_0_, empresas0_.TELEFONO_CONT as TELEFON62_0_, empresas0_.TIPO_EMP as TIPO63_0_, empresas0_.TIPO_R as TIPO64_0_, empresas0_.TOMO_R as TOMO65_0_, empresas0_.VIAPUBLICA as VIAPUBL66_0_, empresas0_.WEB as WEB67_0_, empresas0_.WEBCONTACTO as WEBCONT68_0_ from empresas empresas0_
oct 23, 2014 2:58:29 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 335544569, SQLState: 42000
oct 23, 2014 2:58:29 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 2122
SUB_TYPE
oct 23, 2014 2:58:29 PM org.apache.catalina.core.StandardWrapperValve invoke
Grave: El Servlet.service() para el servlet [apliconta2web] en el contexto con ruta [/Apliconta2Web] lanzó la excepción [Request processing failed; nested exception is org.hibernate.exception.SQLGrammarException: could not prepare statement] con causa raíz
org.firebirdsql.gds.GDSException: Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 2122
SUB_TYPE
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2092)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2042)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlPrepare(AbstractJavaGDSImpl.java:1465)
at org.firebirdsql.gds.impl.GDSHelper.prepareStatement(GDSHelper.java:190)
at org.firebirdsql.jdbc.AbstractStatement.prepareFixedStatement(AbstractStatement.java:1441)
at org.firebirdsql.jdbc.AbstractPreparedStatement.prepareFixedStatement(AbstractPreparedStatement.java:1285)
at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:135)
at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:40)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.firebirdsql.jdbc.FBStatementFactory.createPreparedStatement(FBStatementFactory.java:89)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:1187)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:942)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:896)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:324)
at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:281)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:313)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:161)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:182)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:159)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1858)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1835)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1815)
at org.hibernate.loader.Loader.doQuery(Loader.java:899)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
at org.hibernate.loader.Loader.doList(Loader.java:2522)
at org.hibernate.loader.Loader.doList(Loader.java:2508)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2338)
at org.hibernate.loader.Loader.list(Loader.java:2333)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:490)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1269)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
at com.atorresbr.springapp.EmpresasDAOImpl.findAll(EmpresasDAOImpl.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.Nativ
app-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<!-- Scans the classpath of this application for @Components @Service @Repository to deploy as
beans -->
<context:component-scan base-package="com.atorresbr.springapp" />
<!-- Configures the @Controller programming model -->
<mvc:annotation-driven />
<!-- Map simple view name such as "test" into /WEB-INF/test.jsp -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/jdbc.properties" />
<!-- JDBC Data Source. It is assumed you have MySQL running on localhost port 3306 with
username root and blank password. Change below if it's not the case -->
<bean id="myDataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.databaseurl}"
p:username="${jdbc.username}"
p:password="${jdbc.password}"
p:validationQuery="${jdbc.validationQuery}" />
<!--
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/pizzashop"/>
<property name="username" value="root"/>
<property name="password" value=""/>
<property name="validationQuery" value="SELECT 1"/>
</bean> -->
<!-- Hibernate Session Factory -->
<bean id="mySessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="myDataSource"/>
<property name="packagesToScan">
<array>
<value>com.atorresbr.springapp</value>
</array>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${jdbc.dialect}</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<!-- Hibernate Transaction Manager -->
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="mySessionFactory"/>
</bean>
<!-- Activates annotation based transaction management -->
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
jdbc.properties
jdbc.driverClassName= org.firebirdsql.jdbc.FBDriver
jdbc.dialect=org.hibernate.dialect.FirebirdDialect
jdbc.databaseurl=jdbc:firebirdsql:PROSYTH-PC/3050:C:/aplifisa/contcs/CONTBD
jdbc.username=SYSDBA
jdbc.password=masterkey
jdbc.validationQuery=Select 1 from rdb$database
EmpresasController.java
package com.atorresbr.springapp;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.atorresbr.springapp.EmpresasService;
import com.atorresbr.springapp.Empresas;
@Controller
@RequestMapping("/")
public class EmpresasController {
// @Autowired private EmpresasDAO empresasDAO;
@Autowired private EmpresasService empresasService;
protected final Log logger = LogFactory.getLog(getClass());
@RequestMapping(method = RequestMethod.GET)
public String list(Model model) {
List<Empresas> empresas = empresasService.findAll();
model.addAttribute("empresas", empresas);
return "views/index";}
EmpresasServiceIMPL
package com.atorresbr.springapp;
//imports..
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.atorresbr.springapp.Empresas;
@Service
public class EmpresasServiceImpl implements EmpresasService {
@Autowired
private EmpresasDAO empresasDAO;
/**
* @Transactional annotation below will trigger Spring Hibernate transaction manager to automatically create
* a hibernate session. See src/main/webapp/WEB-INF/servlet-context.xml
*/
@Transactional
public List<Empresas> findAll() {
return empresasDAO.findAll();
}
}
EmpresasDAOIMPL
package com.atorresbr.springapp;
//imports..
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
@Repository
@SuppressWarnings({"unchecked", "rawtypes"})
public class EmpresasDAOImpl implements EmpresasDAO {
@Autowired private SessionFactory sessionFactory;
/**
* @Transactional annotation below will trigger Spring Hibernate transaction manager to automatically create
* a hibernate session. See src/main/webapp/WEB-INF/servlet-context.xml
*/
@Transactional
public List<Empresas> findAll() {
Session session = sessionFactory.getCurrentSession();
List empresas = session.createQuery("from Empresas").list();
return empresas;
}
}
Empresas.java
package com.atorresbr.springapp;
// imports ..
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.sql.Blob;
import java.util.Date;
@Entity
@Table(name = "empresas")
public class Empresas {
@Id
@Column(name = "CLAVE")
@GeneratedValue private long CLAVE;
@Column(name = "NOMBRE")
private String NOMBRE;
@Column(name = "DNICIF")
private String DNICIF;
@Column(name = "SIGLA")
private String SIGLA;
@Column(name = "VIAPUBLICA")
private String VIAPUBLICA;
@Column(name = "NUMERO")
private String NUMERO;
@Column(name = "PISO")
private String PISO;
@Column(name = "PUERTA")
private String PUERTA;
@Column(name = "MUNICIPIO")
private String MUNICIPIO;
@Column(name = "CODPOSTAL")
private String CODPOSTAL;
@Column(name = "PROVINCIA")
private String PROVINCIA;
@Column(name = "TELEFONO")
private String TELEFONO;
@Column(name = "FAX")
private String FAX;
@Column(name = "ADMON")
private String ADMON;
@Column(name = "NIVEL")
private long NIVEL;
@Column(name = "EJERCICIO")
private String EJERCICIO;
@Column(name = "FECHAINI")
private Date FECHAINI;
@Column(name = "FECHAFIN")
private Date FECHAFIN;
@Column(name = "PAG_ASIEN")
private String PAG_ASIEN;
private String COBROS;
@Column(name = "OCUPADO")
private String OCUPADO;
@Column(name = "CONTRASE")
private String CONTRASE;
@Column(name = "ACT_CONTRASE")
private String ACT_CONTRASE;
@Column(name = "BALANCE")
private String BALANCE;
@Column(name = "COOPERA")
private String COOPERA;
@Column(name = "WEB")
private String WEB;
@Column(name = "CORREO")
private String CORREO;
@Column(name = "IGIC_IVA")
private String IGIC_IVA;
@Column(name = "OBSERVACIONES")
private String OBSERVACIONES;
@Column(name = "CONTACTO")
private String CONTACTO;
@Column(name = "TELEFONO_CONT")
private String TELEFONO_CONT;
@Column(name = "CODPAIS")
private String CODPAIS;
@Column(name = "TIPO_EMP")
private String TIPO_EMP;
@Column(name = "BALANCE_UE")
private String BALANCE_UE;
@Column(name = "E_RETEN")
private String E_RETEN;
@Column(name = "FECHA_BAJA")
private Date FECHA_BAJA;
@Column(name = "GES_PROYECTOS")
private String GES_PROYECTOS;
@Column(name = "TOMO_R")
private String TOMO_R;
@Column(name = "LIBRO_R")
private String LIBRO_R;
@Column(name = "SECCION_R")
private String SECCION_R;
@Column(name = "FOLIO_R")
private String FOLIO_R;
@Column(name = "TIPO_R")
private String TIPO_R;
@Column(name = "HOJA_R")
private String HOJA_R;
@Column(name = "OTROS_R")
private String OTROS_R;
@Column(name = "REGMER")
private String REGMER;
@Column(name = "SUB_TYPE")
private Blob SUB_TYPE;
@Column(name = "ILOGO")
private String ILOGO;
@Column(name = "INUMERO")
private String INUMERO;
@Column(name = "WEBCONTACTO")
private String WEBCONTACTO;
@Column(name = "MOVILCONTACTO")
private String MOVILCONTACTO;
@Column(name = "REGVENTAS")
private String REGVENTAS;
@Column(name = "REGCOMPRAS")
private String REGCOMPRAS;
@Column(name = "SUBC_DESP1")
private String SUBC_DESP1;
@Column(name = "SUBC_DESP2")
private String SUBC_DESP2;
@Column(name = "SUBC_DESP3")
private String SUBC_DESP3;
@Column(name = "SUBC_DESP4")
private String SUBC_DESP4;
@Column(name = "SUBC_DESPI1")
private String SUBC_DESPI1;
@Column(name = "SUBC_DESPI2")
private String SUBC_DESPI2;
@Column(name = "SUBC_DESPI3")
private String SUBC_DESPI3;
@Column(name = "SUBC_DESPI4")
private String SUBC_DESPI4;
@Column(name = "SUBC_DESPI5")
private String SUBC_DESPI5;
@Column(name = "SUBC_DESPI6")
private String SUBC_DESPI6;
@Column(name = "SUBC_DESPC1")
private String SUBC_DESPC1;
@Column(name = "SUBC_DESP7")
private String SUBC_DESP7;
@Column(name = "GES_DOCU")
private String GES_DOCU;
@Column(name = "CRITERIOCAJA")
private String CRITERIOCAJA;
@Column(name = "DOC3W_REFURL")
private String DOC3W_REFURL;
@Column(name = "DOC3W_AUTOGESTION")
private String DOC3W_AUTOGESTION;
/* getters & setters */
public long getCLAVE() {
return CLAVE;
}
public void setCLAVE(long CLAVE) {
this.CLAVE = CLAVE;
}
public String getNOMBRE() {
return NOMBRE;
}
public void setNOMBRE(String NOMBRE) {
this.NOMBRE = NOMBRE;
}
.
.
.
Etc etc //setters.
最佳答案
鉴于错误:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 2122
SUB_TYPE
生成的查询中的字符 2122 位于生成的查询中的 SUB_TYPE
处(..., empresas0_.SUB_TYPE as SUB60_0_, ...
附近);考虑到 SUB_TYPE 是一个关键字(但不是保留字),用于指示 blob 的类型(例如在创建表或转换中),我最初的猜测是:
@Column(name = "SUB_TYPE")
private Blob SUB_TYPE;
然而,针对 Firebird 3 快照的快速测试表明这是一个有效的列名称。我目前无法访问已发布的 Firebird 版本(例如 Firebird 2.5.3),因此 Firebird 2.5(或您正在使用的版本)和 Firebird 3 之间的某些解析器规则可能已放宽。如果是这种情况,那么强制 Hibernate 引用对象名称可能会有所帮助(注意额外的引号):
@Column(name = "`SUB_TYPE`")
private Blob SUB_TYPE;
关于java - Estado HTTP 500 - 请求处理失败;嵌套异常是 org.hibernate.exception.SQLGrammarException : could not prepare statement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26530947/
什么是 hibernate 和n- hibernate ?我可以在 Visual Studio 2008 中使用它进行 C# Web 应用程序开发吗?请给我建议...我是 asp.net Web 应用
我有一个不系统地发生的异常(exception)。 我试图通过在每次迭代中刷新和清理 session 来解决此问题,但没有成功。 [quartzScheduler_Worker-7] ERROR jd
使用 Hibernate 在数据库中存储 IP 地址的最佳类型是什么? 我虽然是 Byte[] 或 String,但有没有更好的方法,或者你用什么? @Column(name = "range_fr
我正在尝试制定一个公式来选择用户个人资料的用户友好名称。它选择名字 + ' ' + 姓氏 如果其中至少有一个不为空且不为空(包含非空白字符),否则选择 短名称 (条件相同),最后,如果 短名称 为空或
在hibernate中,是否可以将鉴别器作为一个实体?例如,如果我将 Department 作为基类,将 AdminDepartment 和 ProcessingDepartment 作为子类。 De
我只想从表中获取一些列值。因此,我已经使用投影来实现这一目标。该代码有效,但我认为它无效。 我的问题是当我使用ProjectionsList并将标准条件列表设置为ArrayList时-Bulletin
你好: 我对 hibernate 缓存缓存的内容感到困惑。 从文档中,我知道 hibernate 中有缓存类型。 一级 :交易级别。 似乎要被 session 持久化的实体被缓存在这里。 二级缓存 :
我遇到了一个情况: save或update hibernate 的目标表中的某些数据 在目标表上有一个触发器,该触发器将在目标表的insert或update操作之前执行 由 hibernate 将此记
我有一个名为 Master_Info_tbl 的表。它是一个查询表: 这是该表的代码: @Entity @Table(name="MASTER_INFO_T") public class Code
我想知道如何在 Hibernate 查询语言中使用日期文字。我在我的 JPA 项目中做了如下操作(作为 Eclipselink 提供者)并且它工作正常。 SELECT m FROM Me m WHER
@Entity public class Troop { @OneToMany(mappedBy="troop") public Set getSoldiers() { ...
我正在尝试使用 hibernate 查询删除表 'user_role' 中的所有行。但每次我都会出错。有人可以帮我吗。 DaoImpl @Override public void deleteAll(
不是将数据库操作分散在四个 (osgi) 包中,而是在那里做略有不同的事情。我想创建一个负责所有持久性问题的(简单的)OSGi 包。我觉得这并不像听起来那么简单,因为“每个包都有独特的类加载器”。 因
这就是我使用生成器的方式: private Integer id; 我看到的行为是: 创建第一个对象 hibernate 分配 id = 1 删除该对象 关闭服务
对象级别的实体和值类型有什么区别。我知道实体将有一个 id 但值不会,但为什么我们需要不同的方法来映射实体与值类型? 这样做是为了让hibernate可以对值类型应用任何优化吗? 最佳答案 一个实体已
我正在使用 HibernateTemplate.findByCriteria 方法进行一些查询。现在我想在标准上创建一些 SQL 限制,比如 criteria.add(Restrictions.sql
所以我有以下代码: Query query = session.createQuery("from Weather"); List list = query.list();
如何使用Hibernate映射具有多个实体的 View ? 问候, 混沌 最佳答案 请参见Hibernate文档中第5.1.3节“类”,紧接在“Id”节之前: There is no differen
据我所知,Hibernate 有两种类型的实现 JPA的实现(2)(@Entity,@Table注解) 扩展到旧的(传统的) hibernate (没有 JPA),使用 HSQL 查询,没有注释 如果
我需要一个将条目存储为键值对的集合(因此我可以通过键查找值),但我需要一个允许多个值使用 hibernate 共享同一个键的集合 最佳答案 一个键具有多个值的映射称为多映射 - 在 Apache 公共
我是一名优秀的程序员,十分优秀!