id within composite-id
by Fabiano Oliveira
hello,
I have a problem with generator id with composite-id.
How might procedure into composite-id one id.
regards,
Fabiano Eduardo de Oliveira
19 years, 4 months
[Hibernate-JIRA] Updated: (HHH-1829) Allow join on any property using property-ref
by Andrew Seales (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829?page=all ]
Andrew Seales updated HHH-1829:
-------------------------------
Attachment: hhh-1829.patch
I've started working on a patch for this issue as
we're using a legacy database and need to do a join that doesn't use a
primary key. I have a working patch at the moment which seems to fix the
issue(at least for our uses), although I'm not sure how 'nice' it is.
When I looked through the code, I couldn't see the 'property-ref'
attribute in the <key> tag being stored anywhere so I have added it to
the KeyValue interface. This value is also stored in the
AbstractEntityPersister class, similarly to rootTableKeyColumnNames.
When the join is made, a check is performed to see if an alternative key
should be used in the join. If there is no property-ref specified then
the primary keys are used, otherwise the property-ref column is used.
> Allow join on any property using property-ref
> ---------------------------------------------
>
> Key: HHH-1829
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829
> Project: Hibernate3
> Type: New Feature
> Components: core
> Versions: 3.2.0 cr1, 3.2.0.cr2
> Reporter: Maarten Winkels
> Attachments: hhh-1829.patch
>
>
> Currently joining tables for one class (uing the <join...> tag) is only supported for the id property. The property-ref is allowed on the <key..> tag inside the <join..> tag, but this is ignored.
--
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
19 years, 4 months
[Hibernate-JIRA] Created: (ANN-490) Cannot serialize AnnotationConfiguration
by Mark Hobson (JIRA)
Cannot serialize AnnotationConfiguration
----------------------------------------
Key: ANN-490
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-490
Project: Hibernate Annotations
Type: Bug
Components: binder
Versions: 3.2.0.ga
Environment: Hibernate 3.2.0.ga
Reporter: Mark Hobson
Attachments: SerializationTest.java
AnnotationConfiguration cannot be serialized due to JavaXClass. The attached testcase throws the following exception:
org.hibernate.type.SerializationException: could not serialize
at org.hibernate.util.SerializationHelper.serialize(SerializationHelper.java:158)
at SerializationTest.testAnnotationConfigurationSerialization(SerializationTest.java:26)
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:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.io.NotSerializableException: org.hibernate.reflection.java.JavaXClass
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at java.util.ArrayList.writeObject(ArrayList.java:569)
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:585)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at org.hibernate.util.SerializationHelper.serialize(SerializationHelper.java:154)
... 19 more
--
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
19 years, 4 months
[Hibernate-JIRA] Created: (HBX-828) precision/scaling not taken in hbm2hbm in ant env.
by kk (JIRA)
precision/scaling not taken in hbm2hbm in ant env.
--------------------------------------------------
Key: HBX-828
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-828
Project: Hibernate Tools
Type: Bug
Components: ant
Versions: 3.2beta8
Environment: MySQL 5+Hibernate 3.2GA+XP Pro SP2
Reporter: kk
For a simple test case, I found precision and scale aren't taken by Hibernate Tool 3.2 beta 8 with MySQL 5. Here is my test case (pay attention to "test" field),
CREATE TABLE `test` (
`id` int(5) NOT NULL,
`test` smallint(2) default NULL,
`comment` char(1) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
<hibernate-reverse-engineering>
<schema-selection match-table="test"/>
<type-mapping>
<!-- jdbc-type is name fom java.sql.Types -->
<sql-type jdbc-type="CHAR" length="1" hibernate-type="yes_no"/>
<sql-type jdbc-type="SMALLINT" hibernate-type="java.lang.Integer"/>
</type-mapping>
<!--sql-type jdbc-type="SMALLINT" precision="2" scale="0" hibernate-type="java.lang.Integer"/-->
<table name="test">
<primary-key>
<generator class="native"/>
</primary-key>
</table>
</hibernate-reverse-engineering>
Form log file I noticed this difference,
1. Without precision and attribute specified
[hibernatetool] (cfg.JDBCBinder 803 ) Building property id
[hibernatetool] (cfg.JDBCBinder 542 ) Scanning org.hibernate.cfg.reveng.TableIdentifier(test) for <version>/<timestamp> columns.
[hibernatetool] (cfg.JDBCBinder 552 ) No columns reported while scanning for <version>/<timestamp> columns in org.hibernate.cfg.reveng.TableIdentifier(test)
[hibernatetool] (reveng.OverrideRepository 312 ) columnToHibernateTypeName, <type-mapping> found: java.lang.Integer for Table: test column: test
[hibernatetool] (cfg.JDBCBinder 635 ) Sql type mismatch for Table: test column: test between DB and wanted hibernate type. Sql type set to 5(SMALLINT) instead of 4(INTEGER)
[hibernatetool] (cfg.JDBCBinder 803 ) Building property test
[hibernatetool] (reveng.OverrideRepository 312 ) columnToHibernateTypeName, <type-mapping> found: yes_no for Table: test column: comment
2. With precision and attribute specified
[hibernatetool] (cfg.JDBCBinder 803 ) Building property id
[hibernatetool] (cfg.JDBCBinder 542 ) Scanning org.hibernate.cfg.reveng.TableIdentifier(test) for <version>/<timestamp> columns.
[hibernatetool] (cfg.JDBCBinder 552 ) No columns reported while scanning for <version>/<timestamp> columns in org.hibernate.cfg.reveng.TableIdentifier(test)
[hibernatetool] (cfg.JDBCBinder 803 ) Building property test
[hibernatetool] (reveng.OverrideRepository 312 ) columnToHibernateTypeName, <type-mapping> found: yes_no for Table: test column: comment
So I can't convert Short to Integer with desired precision/scalling. Original post is at http://forum.hibernate.org/viewtopic.php?t=967518&sid=d73f6dfc4663f78f27f...
--
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
19 years, 4 months