[Hibernate-JIRA] Created: (HHH-3350) Error in creating Schema update script: if exist a view in Oracle db and exist a class with @Entity for this, then raises the "ORA-01702: a view is not appropriate here" exception
by Béla Berecz (JIRA)
Error in creating Schema update script: if exist a view in Oracle db and exist a class with @Entity for this, then raises the "ORA-01702: a view is not appropriate here" exception
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-3350
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3350
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Reporter: Béla Berecz
(sorry for my bad english)
When deploying:
16:28:03,737 INFO [SchemaUpdate] Running hbm2ddl schema update
16:28:03,737 INFO [SchemaUpdate] fetching database metadata
16:28:04,128 INFO [SchemaUpdate] updating schema
...
16:28:59,565 WARN [JDBCExceptionReporter] SQL Error: 1702, SQLState: 42000
16:28:59,565 ERROR [JDBCExceptionReporter] ORA-01702: a view is not appropriate here
16:28:59,565 ERROR [SchemaUpdate] could not complete schema update
org.hibernate.exception.SQLGrammarException: could not get table metadata: TABLE_VIEW
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:105)
at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:954)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:140)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:314)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy66.start(Unknown Source)
at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:120)
at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:551)
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:333)
at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy33.start(Unknown Source)
at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
at org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:93)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy34.start(Unknown Source)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: ORA-01702: nézet itt nem fordulhat elő
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1614)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1579)
at oracle.jdbc.OracleDatabaseMetaData.getIndexInfo(OracleDatabaseMetaData.java:3485)
at com.p6spy.engine.spy.P6DatabaseMetaData.getIndexInfo(P6DatabaseMetaData.java:210)
at org.hibernate.tool.hbm2ddl.TableMetadata.initIndexes(TableMetadata.java:130)
at org.hibernate.tool.hbm2ddl.TableMetadata.<init>(TableMetadata.java:35)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:90)
... 150 more
Problem with TableMetadata.java row 35: initIndexes(meta);
I couldn't create index for view in Oracle, hence (I think) drop a SQLGrammarException when running initIndexes(meta).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 9 months
[Hibernate-JIRA] Created: (HHH-2599) Inconsistent behaviour with Cascade Refresh and lazy loaded collections
by Guy Chua (JIRA)
Inconsistent behaviour with Cascade Refresh and lazy loaded collections
-----------------------------------------------------------------------
Key: HHH-2599
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2599
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.3
Environment: 3.2.3, hsqldb/mysql
Reporter: Guy Chua
Attachments: cascadeTest.zip
According to the specs for session.refresh(), the state of the given instance will be re-read from the database. I have a model 'Company' that has 2 lazy collections, departments and employees.
Snippet of class Company
--------------------------------------------------------------------
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 1
private Set<Department> departments; // POINT 1
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 2
private Set<Employee> employees; // POINT 2
Snippet of class CascadeTestRunner
--------------------------------------------------------------------
public void doRefreshTest() {
session = sessionFactory.openSession();
session.getTransaction().begin();
Company loadedCompany = (Company)session.get(Company.class, companyId);
logger.debug(loadedCompany);
// session.refresh(loadedCompany); // POINT A
session.close();
Set<Department> loadedDepartments = loadedCompany.getDepartments();
logger.debug("TEST for LAZY DEPARTMENTS [START]");
for (Department tmpDepartment : loadedDepartments) {
logger.debug(tmpDepartment); // POINT B
}
logger.debug("TEST for LAZY DEPARTMENTS [END]");
Set<Employee> loadedEmployees = loadedCompany.getEmployees();
logger.debug("TEST for LAZY EMPLOYEES [START]");
for (Employee tmpEmployee : loadedEmployees) {
logger.debug(tmpEmployee); // POINT C
}
logger.debug("TEST for LAZY EMPLOYEES [END]");
}
If I run the above code, Point B will give me LazyInitializationException which is the expected behavior. But if i uncomment POINT A, the LazyInitializationException happens at POINT C instead of POINT B. Why should POINT B pass and POINT C fail?
Furthermore, with POINT A still uncommented and when I swap the position of POINT 1 with POINT 2, the LazyInitializationException happens at POINT B now. I am wondering why the position of the fields produce the exception at a different location.
What happens when a lazy collection annotated with CascadeType.Refresh is refreshed? I am getting varied results, sometimes the collection is initialized, sometimes it is not. Is it supposed to cascade the refresh to lazy elements in the first place?
Hope someone can shed some light on this.
Test Results
------------------
1. LazyInitializationException at POINT B
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 1
private Set<Department> departments; // POINT 1
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 2
private Set<Employee> employees; // POINT 2
// session.refresh(loadedCompany); // POINT A
logger.debug(tmpDepartment); // POINT B
logger.debug(tmpEmployee); // POINT C
2. LazyInitializationException at POINT C
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 1
private Set<Department> departments; // POINT 1
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 2
private Set<Employee> employees; // POINT 2
session.refresh(loadedCompany); // POINT A
logger.debug(tmpDepartment); // POINT B
logger.debug(tmpEmployee); // POINT C
2. LazyInitializationException at POINT B when positions of POINT 1 and POINT 2 are swapped
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 2
private Set<Employee> employees; // POINT 2
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 1
private Set<Department> departments; // POINT 1
session.refresh(loadedCompany); // POINT A
logger.debug(tmpDepartment); // POINT B
logger.debug(tmpEmployee); // POINT C
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 9 months
[Hibernate-JIRA] Created: (BVAL-41) Support BeanInfo implementation to receive property names
by Emmanuel Bernard (JIRA)
Support BeanInfo implementation to receive property names
---------------------------------------------------------
Key: BVAL-41
URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-41
Project: Bean Validation
Issue Type: Improvement
Components: spec-general
Reporter: Emmanuel Bernard
Michael
- Why section 3.1.2 requires properties to follow the JavaBeans naming
convention? In many non-English speaking countries (and projects with
ridiculous managers/code standards), other prefixes are used and
proper BeanInfo implementations are supplied. Although it is not
pretty at all, since they are following the JavaBean spec, I don't
think Bean Validation shouldn't work out-of-the-box for them;
Emmanuel
I reused the Java Persistence wording actually and I explicitly reference
the Introspector class. Do people think we should be more cautious here?
Speaking for France, I've never seen a project bothering about get/is/set
and BeanInfo. People happily used frenglish: getCafeAuLait()
Actually I've never seen anybody from the server side bothering about
BeanInfos ;)
Michael
I've got an interesting case for that one: in some JVM languages,
another standard is used to represent properties. Let's take, for
instance, Scala.
In Scala, one could write a bean like:
@BeanInfo
class Person(var id : Long, var name : String, var surname : String)
Scala already maps vars as properties creating a private var, a public
getter method named like the var and a setter like var_=. Something
like:
private var _id : Long
def id = _id
def id_=(newId: Long) = _id = newId
that would translate to Java methods id and id_$eq (since = cannot be
used in method names). So, when one use @BeanInfo, a proper BeanInfo
subclass is generated by the compiler providing that mapping.
Given how popular JVM languages are getting, not following a spec in
another one and causing property support in those languages to fail to
work doesn't seem nice.
BTW, please let the JPA EG know about his as well.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 9 months
[Hibernate-JIRA] Créée: (HHH-2060) To be able to use <generator> with <composite-id>
by Xavier Brénuchon (JIRA)
To be able to use <generator> with <composite-id>
-------------------------------------------------
Key: HHH-2060
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2060
Project: Hibernate3
Type: Improvement
Versions: 3.2.0.cr4
Environment: Hibernate 3.x
Reporter: Xavier Brénuchon
Hello,
This is the continuation of HB-389
We develop an application which has very strong need for performance with several tens of million recordings. Partitioning is a need.
So for that, I use <composite-id>. But my primary key is not a natural key, but a real technical key :
- column of partitioning for optimization of the data base
- column of technical id
So I need to have a generator, for exemple :
<composite-id name="id" class="IdPartition">
<key-property name="org" type="string" column="ORG"/>
<key-property name="id" type="long" column="ID"/>
<generator class="fr.test.xavier.IdPartitionGenerator">
<param name="table">TAB_SEQ</param>
<param name="column">LAST</param>
</generator>
</composite-id>
The good news is that Hibernate can use that (HB-389).
In fact, it is enough to modify the DTD to authorize <generator> in <composite-id> and it is all. The current code of Hibernate manages it very well.
Is it possible that Hibernate is enriched by this functionality?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
15 years, 9 months
[Hibernate-JIRA] Created: (HHH-3531) Constraint violation Error
by suman (JIRA)
Constraint violation Error
--------------------------
Key: HHH-3531
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3531
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: Spring/Hibernate/Mysql/
Reporter: suman
Hello All,
I am Using Spring with Hibernate in my web application.I got Syncronize Exception in some Cases.Atually i am updating to table(sno[PK,Auto increment],acno,pan)
In my HBM file i am mentioning sno as increment of generator class.Keen obeservation i am not getting this sort of problem always.In some Time i got this sort of proble,
Log as follows:
INFO | jvm 2 | 2008/10/15 16:06:25 | 16:06:25,353 WARN JDBCExceptionReporter:71 - SQL Error: 1062, SQLState: 23000
INFO | jvm 2 | 2008/10/15 16:06:25 | 16:06:25,354 ERROR JDBCExceptionReporter:72 - Duplicate key or integrity constraint violation, message from server: "Duplicate entry '984041' for key 1"
INFO | jvm 2 | 2008/10/15 16:06:25 | 16:06:25,355 ERROR AbstractFlushingEventListener:277 - Could not synchronize database state with session
INFO | jvm 2 | 2008/10/15 16:06:25 | org.hibernate.exception.ConstraintViolationException: could not insert: [com.xxx.model.map]
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 10 months
[Hibernate-JIRA] Created: (BVAL-36) Validation of method parameters and returned values
by Emmanuel Bernard (JIRA)
Validation of method parameters and returned values
---------------------------------------------------
Key: BVAL-36
URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-36
Project: Bean Validation
Issue Type: New Feature
Components: spec-general
Reporter: Emmanuel Bernard
Assignee: Emmanuel Bernard
The goal is to expose the necessary APIs to validate method parameters and returned type. This API can typically be used by an interceptor framework.
Validator {
List<IC> validateParameters(Method, Object[] parameterValues);
List<IC> validateParameter(Method, Object parameterValue, int parameterIndex);
List<IC> validateReturnedValue(Method, Object returnedValue);
List<IC> validateParameters(Constructor, Object[] parameterValues);
List<IC> validateParameter(Constructor, Object parameterValue, int parameterIndex);
}
Metadata
Validator {
BeanDescriptor getConstraintsForBean()
PropertyDescriptor getConstraintsForProperty(String propertyName);
MethodDescriptor getConstraintsForMethod(Method);
MethodDescriptor getConstraintsForConstructor(Constructor);
String[] getValidatedProperties();
Method[] getValidatedMethods();
Constructor[] getValidatedConstructors();
}
ElementDescriptor {
ElementType getElementType();
Class getType();
List<ConstraintDescriptor> getConstraintDescriptors();
}
PropertyDescriptor extends ElementDescriptor {
boolean isCascaded();
String getPropertyPath();
}
ParameterDescriptor extends ElementDescriptor {
boolean isCascaded();
int getIndex();
}
BeanDescriptor extends ElementDescriptor {
}
MethodDescriptor extends ElementDescriptor {
List<ParameterDescriptor> getParameterDescriptors(); //index aligned
boolean isCascaded();
}
ConstructorDescriptor extends ElementDescriptor {
List<ParameterDescriptor> getParameterDescriptors(); //index aligned
}
How to read parameter annotations
Class<?> parameterTypes = method.getParameterTypes()
Annotation[][] parameterAnnotations = method.getParameterAnnotations()
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 10 months