用sqlserver修改表单问题
使用sqlserver数据库。online表单开发,第一次建表没有问题。但是表说明好像没有插入到数据库。然后第二次改表提示失败。找了一下,TableSQLServerHandleImpl的getCommentSql方法,不知道是不是这个方法有问题。具体错误和配置说明下 本帖最后由 acb13202 于 2017-7-7 17:03 编辑
admin 发表于 2017-7-5 14:19 static/image/common/back.gif
具体错误和配置说明下jeecg最新版本
配置信息
jeecg_database.properties
#SQLServer2005\u4ee5\u4e0a
diver_name=org.hibernate.dialect.SQLServerDialect
url=jdbc:sqlserver://localhost:1433;DatabaseName=jeecg
username=sa
password=123123
database_name=jeecg
dbconfig.properties
hibernate.dialect=org.jeecgframework.core.common.hibernate.dialect.MySQLServer2008Dialect
validationQuery.sqlserver=SELECT 1
jdbc.url.jeecg=jdbc:sqlserver://localhost:1433;DatabaseName=jeecg
jdbc.username.jeecg=sa
jdbc.password.jeecg=123123
jdbc.dbType=sqlserver
sysConfig.properties
#database type for spring jdbc
jdbc.url.jeecg=sqlserver
spring-minidao.xml
<property name="dbType" value="sqlserver"></property>
admin 发表于 2017-7-5 14:19 static/image/common/back.gif
具体错误和配置说明下
新建表没加任何字段同步是这样的,
七月 07, 2017 2:19:59 下午 org.apache.tomcat.util.http.Parameters processParameters
警告: Parameters: Invalid chunk '' ignored.
<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-
mapping-3.0.dtd">
<hibernate-mapping>
<class name="test2" table="test2" optimistic-lock="version">
<id name="id" type="java.lang.String" length="36" unsaved-value="null">
<generator class="uuid" />
</id>
<property name="bpm_status"
type="java.lang.String"
access="property">
<column name="bpm_status" length="32"
default="1"
not-null="false" unique="false">
<comment>流程状态</comment>
</column>
</property>
......字数太多
<column name="update_date" length="20"
not-null="false" unique="false">
<comment>更新日期</comment>
</column>
</property>
</class>
</hibernate-mapping>
HHH000223: Recognized obsolete hibernate
namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6
Migration Guide!
create table test2 (
id varchar(36) not null,
bpm_status varchar(32) default 1,
create_name varchar(50),
create_by varchar(50),
update_name varchar(50),
update_by varchar(50),
sys_org_code varchar(50),
sys_company_code varchar(50),
create_date datetime2,
update_date datetime2,
primary key (id)
)
admin 发表于 2017-7-5 14:19 static/image/common/back.gif
具体错误和配置说明下
然后我加个字段,test
getColumnMetadataFormDataBase --->COLUMN_NAME:ID TYPE_NAME :varchar DECIMAL_DIGITS:0 COLUMN_SIZE:36
getColumnMetadataFormDataBase --->COLUMN_NAME:BPM_STATUS TYPE_NAME :varchar DECIMAL_DIGITS:0 COLUMN_SIZE:32
getColumnMetadataFormDataBase --->COLUMN_NAME:CREATE_NAME TYPE_NAME :varchar DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormDataBase --->COLUMN_NAME:CREATE_BY TYPE_NAME :varchar DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormDataBase --->COLUMN_NAME:UPDATE_NAME TYPE_NAME :varchar DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormDataBase --->COLUMN_NAME:UPDATE_BY TYPE_NAME :varchar DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormDataBase --->COLUMN_NAME:SYS_ORG_CODE TYPE_NAME :varchar DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormDataBase --->COLUMN_NAME:SYS_COMPANY_CODE TYPE_NAME :varchar DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormDataBase --->COLUMN_NAME:CREATE_DATE TYPE_NAME :datetime2 DECIMAL_DIGITS:0 COLUMN_SIZE:27
getColumnMetadataFormDataBase --->COLUMN_NAME:UPDATE_DATE TYPE_NAME :datetime2 DECIMAL_DIGITS:0 COLUMN_SIZE:27
getColumnMetadataFormCgForm ---->COLUMN_NAME:id TYPE_NAME:string DECIMAL_DIGITS:0 COLUMN_SIZE:36
getColumnMetadataFormCgForm ---->COLUMN_NAME:bpm_status TYPE_NAME:string DECIMAL_DIGITS:0 COLUMN_SIZE:32
getColumnMetadataFormCgForm ---->COLUMN_NAME:create_name TYPE_NAME:string DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormCgForm ---->COLUMN_NAME:create_by TYPE_NAME:string DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormCgForm ---->COLUMN_NAME:update_name TYPE_NAME:string DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormCgForm ---->COLUMN_NAME:update_by TYPE_NAME:string DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormCgForm ---->COLUMN_NAME:sys_org_code TYPE_NAME:string DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormCgForm ---->COLUMN_NAME:sys_company_code TYPE_NAME:string DECIMAL_DIGITS:0 COLUMN_SIZE:50
getColumnMetadataFormCgForm ---->COLUMN_NAME:create_date TYPE_NAME:date DECIMAL_DIGITS:0 COLUMN_SIZE:20
getColumnMetadataFormCgForm ---->COLUMN_NAME:update_date TYPE_NAME:date DECIMAL_DIGITS:0 COLUMN_SIZE:20
getColumnMetadataFormCgForm ---->COLUMN_NAME:test TYPE_NAME:string DECIMAL_DIGITS:0 COLUMN_SIZE:32
[alter tabletest2
ALTER COLUMNid varchar(36) NOT NULL ;, EXECUTE sp_updateextendedproperty N'MS_Description', '主键', N'SCHEMA', N'dbo',
N'TABLE', N'test2', N'COLUMN', N'id', alter tabletest2ALTER COLUMNsys_org_code varchar(50) NULL ;, EXECUTE
sp_updateextendedproperty N'MS_Description', '所属部门', N'SCHEMA', N'dbo', N'TABLE', N'test2', N'COLUMN', N'sys_org_code',
alter tabletest2ALTER COLUMNbpm_status varchar(32) NULL DEFAULT 1;, EXECUTE sp_updateextendedproperty N'MS_Description',
'流程状态', N'SCHEMA', N'dbo', N'TABLE', N'test2', N'COLUMN', N'bpm_status', alter tabletest2ALTER COLUMNcreate_date
datetime NULL ;, EXECUTE sp_updateextendedproperty N'MS_Description', '创建日期', N'SCHEMA', N'dbo', N'TABLE', N'test2',
N'COLUMN', N'create_date', alter tabletest2ADDtest varchar(32) NULL ;, EXECUTE sp_updateextendedproperty
N'MS_Description', 'test', N'SCHEMA', N'dbo', N'TABLE', N'test2', N'COLUMN', N'test', alter tabletest2ALTER COLUMN
create_by varchar(50) NULL ;, EXECUTE sp_updateextendedproperty N'MS_Description', '创建人登录名称', N'SCHEMA', N'dbo',
N'TABLE', N'test2', N'COLUMN', N'create_by', alter tabletest2ALTER COLUMNcreate_name varchar(50) NULL ;, EXECUTE
sp_updateextendedproperty N'MS_Description', '创建人名称', N'SCHEMA', N'dbo', N'TABLE', N'test2', N'COLUMN', N'create_name',
alter tabletest2ALTER COLUMNsys_company_code varchar(50) NULL ;, EXECUTE sp_updateextendedproperty N'MS_Description', '所
属公司', N'SCHEMA', N'dbo', N'TABLE', N'test2', N'COLUMN', N'sys_company_code', alter tabletest2ALTER COLUMNupdate_name
varchar(50) NULL ;, EXECUTE sp_updateextendedproperty N'MS_Description', '更新人名称', N'SCHEMA', N'dbo', N'TABLE', N'test2',
N'COLUMN', N'update_name', alter tabletest2ALTER COLUMNupdate_date datetime NULL ;, EXECUTE sp_updateextendedproperty
N'MS_Description', '更新日期', N'SCHEMA', N'dbo', N'TABLE', N'test2', N'COLUMN', N'update_date', alter tabletest2ALTER
COLUMNupdate_by varchar(50) NULL ;, EXECUTE sp_updateextendedproperty N'MS_Description', '更新人登录名称', N'SCHEMA', N'dbo',
N'TABLE', N'test2', N'COLUMN', N'update_by']
SQL Error: 15217, SQLState: S0002
无法更新或删除属性。'dbo.test2.id' 不存在
属性 'MS_Description'。
无法更新或删除属性
。'dbo.test2.id' 不存在属性 'MS_Description'。
org.hibernate.exception.SQLGrammarException: 无法更新或删除属性。'dbo.test2.id' 不存在属性 'MS_Description'。
admin 发表于 2017-7-5 14:19 static/image/common/back.gif
具体错误和配置说明下
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:122)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation
(AbstractStatementProxyHandler.java:129)
at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
at com.sun.proxy.$Proxy125.executeUpdate(Unknown Source)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:916)
at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:909)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:644)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:909)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:970)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:980)
at org.jeecgframework.core.common.dao.impl.GenericBaseCommonDao.executeSql(GenericBaseCommonDao.java:918)
at org.jeecgframework.core.common.service.impl.CommonServiceImpl.executeSql(CommonServiceImpl.java:370)
at org.jeecgframework.web.cgform.service.impl.config.CgFormFieldServiceImpl.dbSynch(CgFormFieldServiceImpl.java:239)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation
(TransactionInterceptor.java:98)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction
(TransactionAspectSupport.java:262)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy92.dbSynch(Unknown Source)
at org.jeecgframework.web.cgform.controller.config.CgFormHeadController.doDbSynch(CgFormHeadController.java:232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod
(HandlerMethodInvoker.java:175)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod
(AnnotationMethodHandlerAdapter.java:446)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle
(AnnotationMethodHandlerAdapter.java:434)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jeecgframework.core.aop.GZipFilter.doFilter(GZipFilter.java:93)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:140)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal
(OpenSessionInViewFilter.java:150)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 无法更新或删除属性。'dbo.test2.id' 不存在属性 'MS_Description'。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1454)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement
(SQLServerPreparedStatement.java:388)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute
(SQLServerPreparedStatement.java:338)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:306)
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeUpdate(FilterChainImpl.java:2717)
at com.alibaba.druid.filter.FilterAdapter.preparedStatement_executeUpdate(FilterAdapter.java:1052)
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_executeUpdate(FilterEventAdapter.java:491)
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_executeUpdate(FilterChainImpl.java:2715)
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.executeUpdate(PreparedStatementProxyImpl.java:106)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeUpdate(DruidPooledPreparedStatement.java:237)
at sun.reflect.GeneratedMethodAccessor394.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation
(AbstractStatementProxyHandler.java:122)
... 67 more
admin 发表于 2017-7-5 14:19 static/image/common/back.gif
具体错误和配置说明下
强制同步提示这些信息,但是强制同步会崩溃浏览器。也没有效果
<?xml version="1.0"
encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-
mapping-3.0.dtd">
<hibernate-mapping>
<class name="test2" table="test2" optimistic-lock="version">
<id name="id" type="java.lang.String" length="36" unsaved-value="null">
<generator class="uuid" />
</id>
<property name="bpm_status"
type="java.lang.String"
access="property">
<column name="bpm_status" length="32"
default="1"
not-null="false" unique="false">
<comment>流程状态</comment>
</column>
</property>
.....字数太多不让发
<property name="test"
type="java.lang.String"
access="property">
<column name="test" length="32"
not-null="false" unique="false">
<comment>test</comment>
</column>
</property>
</class>
</hibernate-mapping>
HHH000223: Recognized obsolete hibernate
namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6
Migration Guide!
create table test2 (
id varchar(36) not null,
bpm_status varchar(32) default 1,
create_name varchar(50),
create_by varchar(50),
update_name varchar(50),
update_by varchar(50),
sys_org_code varchar(50),
sys_company_code varchar(50),
create_date datetime2,
update_date datetime2,
test varchar(32),
primary key (id)
)
请问你解决这个问题了么:(:):),可以把解决方法告诉我么
页:
[1]