[Hibernate-JIRA] Created: (HBX-1149) When working from pure hbm.xml the Ant Tasks for hbm2java and hbm2ddl fail complaining about not finding the class
by Thomas Polliard (JIRA)
When working from pure hbm.xml the Ant Tasks for hbm2java and hbm2ddl fail complaining about not finding the class
------------------------------------------------------------------------------------------------------------------
Key: HBX-1149
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1149
Project: Hibernate Tools
Issue Type: Bug
Components: ant
Affects Versions: 3.2.4 Beta1
Environment: HibernateTools-3.2.4.GA-R200905070146-H18
Hibernate-3.3.2GA
HSQLDB
Ant 1.6 and Ant 1.7
Reporter: Thomas Polliard
Attachments: TestCase.tar.gz
Simple Test Case is included.
This is the output from the ant build
[polliard@iron iCloud] ant pojoexport
Buildfile: build.xml
pojoexport:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.
[hibernatetool] An exception occurred while running exporter #2:hbm2java (Generates a set of .java files)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] Failed in building configuration when adding /Users/polliard/Workspace/iCloud/src/com/polliard/icloud/Author.hbm.xml
[hibernatetool] org.hibernate.InvalidMappingException: Could not parse mapping document from file /Users/polliard/Workspace/iCloud/src/com/polliard/icloud/Author.hbm.xml
[hibernatetool] org.hibernate.MappingException: class com.polliard.icloud.Author not found while looking for property: authorID
[hibernatetool] java.lang.ClassNotFoundException: com.polliard.icloud.Author
[hibernatetool] A class were not found in the classpath of the Ant task.
[hibernatetool] Ensure that the classpath contains the classes needed for Hibernate and your code are in the classpath.
BUILD FAILED
/Users/polliard/Workspace/iCloud/build.xml:30: Failed in building configuration when adding /Users/polliard/Workspace/iCloud/src/com/polliard/icloud/Author.hbm.xml
Total time: 0 seconds
--
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, 5 months
[Hibernate-JIRA] Created: (HHH-4496) Entity with composite-id and serial foreign-key one-to-many set mapping can't be saved under 3.3.x and under 3.2.x can be saved but can't fetch set to father object
by Yi, Han (JIRA)
Entity with composite-id and serial foreign-key one-to-many set mapping can't be saved under 3.3.x and under 3.2.x can be saved but can't fetch set to father object
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-4496
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4496
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.2, 3.3.1, 3.2.5
Environment: jdk1.6.0_13
windows 2003 server
hibernate 3.2.5, 3.3.1, 3.3.2
database: postgreSQL8.4
Reporter: Yi, Han
Mapping:
<class name="ExtraInfo" table="extrainfo">
<composite-id class="ExtraInfoId" name="key">
<key-property column="sn" length="20" name="cid" type="string"/>
<key-property column="composite" length="2" name="composite" type="string"/>
<key-property column="fileName" length="300" name="fileName" type="string"/>
</composite-id>
<property name="id" generated="insert" insert="false" type="java.lang.Integer" unique="true" update="false">
<column name="id" not-null="true"/>
</property>
...
<setinverse="true" name="scanDatas">
<key property-ref="id">
<column name="id"/>
</key>
<one-to-many class="ScanData"/>
</set>
</class>
<class name="ScanData" table="scandata">
<composite-id class="net.vuniverse.app.biochemanalysis.db.model.ScanDataId" name="key">
<key-property column="id" name="id" type="java.lang.Integer"/>
<key-property column="idx" name="idx" type="java.lang.Integer"/>
</composite-id>
<many-to-one fetch="join" insert="false" name="extraInfo" property-ref="id" update="false">
<column name="id"/>
</many-to-one>
<property name="data" type="java.lang.Float">
<column name="data" precision="8" scale="8"/>
</property>
</class>
Code:
ExtraInfoId eid = new ExtraInfoId("a", "1", "aa.txt");
ExtraInfo extra = new ExtraInfo(eid);
session.save(extra);
session.flush();
int id = extra.getId();
for (int i = 0; i < 3; i++) {
ScanData sd = new ScanData(new ScanDataId(id, 1));
sd.setData(0.5f * (i + 1));
session.save(sd);
}
session.flush();
extra = session.createQuery("from ExtraInfo a left join fetch a.scandatas b where a.id='" + id + "'").list().get(0);
Set<ScanData> scandatas = extra.getScanDatas();
for (ScanData sd : scandatas) {
System.out.println(sd.getData());
}
under all version, mapping can be varified correctly.
under version 3.2.5, new ExtraInfo can be saved. but the query with "left join fetch" can't return a Extra with set full of ScanData. the size of scandatas is 0.
under version 3.3.x, new ExtraInfo can't be saved. and the following exception is thrown:
java.lang.ClassCastException: java.lang.Integer
at org.hibernate.type.ComponentType.toLoggableString(ComponentType.java:400)
at org.hibernate.pretty.MessageHelper.collectionInfoString(MessageHelper.java:307)
at org.hibernate.engine.Collections.processReachableCollection(Collections.java:199)
at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java:60)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:124)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:84)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:78)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:161)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
.........
--
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, 5 months
[Hibernate-JIRA] Created: (HHH-4095) bug in org.hibernate.Hibernate.createBlob( InputStream in )
by Stephan Schröder (JIRA)
bug in org.hibernate.Hibernate.createBlob( InputStream in )
-----------------------------------------------------------
Key: HHH-4095
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4095
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: (doesn't matter because ii's just a plain wrong usage of the InputStream.available-mehtode but anyway:) Hibernate. 3.3.2, Hsqldb1.8
Reporter: Stephan Schröder
Priority: Minor
The implementation of org.hibernate.Hibernate.createBlob( InputStream in ) looks like this
public static Blob createBlob(InputStream stream) throws IOException {
return new SerializableBlob( new BlobImpl( stream, stream.available() ) );
}
The second parameter here is supposed to be the length of the inputstream. The problem is that stream.available() doesn't return the length of the inputstream. That's explicitly noted in the Java-API (http://java.sun.com/javase/6/docs/api/java/io/InputStream.html#available):
"Note that while some implementations of InputStream will return the total number of bytes in the stream (on calling available() ), many will not. It is never correct to use the return value of this method to allocate a buffer intended to hold all data in this stream."
This is the source of my problem, only the first available bytes are read out of the inputstream. While the workaround for me is to simply call org.hibernate.Hibernate.createBlob( InputStream in,int length ), the misuse of stream.available() in Hibernate.createBlob( InputStream in ) remains to be resolved.
Solution: the only way to get the length of an InputStream ist to read it completly, if you don't want to do that Hibernate.createBlob( InputStream i ) should be removed.
(By the way, why is length of type int? java.io.File.length() and java.sql.Blob.length() are of type long, so length should be of type long 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, 5 months
[Hibernate-JIRA] Commented: (HHH-1829) Allow join on any property using property-ref
by Mathieu Gervais (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829?page=c... ]
Mathieu Gervais commented on HHH-1829:
--------------------------------------
HHH-1829-3.2.8-SNAPSHOT.patch attached. Some details:
Essentially the mwinkels patch, updated for 3.2.8 + combining the tests on this jira into the patch.
We ran the tests on a patched 3.2.8-SNAPSHOT jar and they passed.
The patch was verified on an application as well (there were some unrelated issues with the upgrade to 3.2.8 itself, but this patch worked).
This verification was in QA, not prod.
Also, I contacted the original patch author (mwinkels) and while he doesn't have any cycles to work on this he provided the following background information for the patch:
-Main changes are in HBMBinder to collect the foreign-key value when set in the mapping and store it in the mapping model.
-Then in the SingleTableEntityPersister there are some changes to work with the join, creating the correct join statements for inserts and queries.
-The rest of the patch basically works to cascade these changes to the concerned classes.
Let us know if we can do anything else to help. Thanks.
> Allow join on any property using property-ref
> ---------------------------------------------
>
> Key: HHH-1829
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829
> Project: Hibernate Core
> Issue Type: New Feature
> Components: metamodel
> Affects Versions: 3.2.0 cr1, 3.2.0.cr2
> Reporter: Maarten Winkels
> Assignee: Anthony Patricio
> Attachments: AbstractJoinTest.java, HHH-1829-3.2.8-SNAPSHOT.patch, HHH-1829-mwinkels.patch, hhh-1829.patch, JoinNoPropertyRefTest.java, JoinPropertyRefTest.java, Person.hbm.xml, Person.java, PersonNoPropertyRef.hbm.xml
>
>
> 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
15 years, 5 months
[Hibernate-JIRA] Updated: (HHH-1829) Allow join on any property using property-ref
by Mathieu Gervais (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829?page=c... ]
Mathieu Gervais updated HHH-1829:
---------------------------------
Attachment: HHH-1829-3.2.8-SNAPSHOT.patch
HHH-1829-3.2.8-SNAPSHOT.patch : HHH-1829-mwinkels.patch updated for 3.2.8-SNAPSHOT (source pulled Oct 12, 2009)
> Allow join on any property using property-ref
> ---------------------------------------------
>
> Key: HHH-1829
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829
> Project: Hibernate Core
> Issue Type: New Feature
> Components: metamodel
> Affects Versions: 3.2.0 cr1, 3.2.0.cr2
> Reporter: Maarten Winkels
> Assignee: Anthony Patricio
> Attachments: AbstractJoinTest.java, HHH-1829-3.2.8-SNAPSHOT.patch, HHH-1829-mwinkels.patch, hhh-1829.patch, JoinNoPropertyRefTest.java, JoinPropertyRefTest.java, Person.hbm.xml, Person.java, PersonNoPropertyRef.hbm.xml
>
>
> 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
15 years, 5 months
[Hibernate-JIRA] Created: (HBX-1148) @Id annotation appears to cause suppression of TemporalType.DATE
by John J. Genoese (JIRA)
@Id annotation appears to cause suppression of TemporalType.DATE
----------------------------------------------------------------
Key: HBX-1148
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1148
Project: Hibernate Tools
Issue Type: Bug
Environment: PostgreSQL 8.4
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
[hibernatetool] INFO [Thread-0] (Version.java:15) - Hibernate Annotations 3.3.1.Beta1
[hibernatetool] INFO [Thread-0] (Environment.java:514) - Hibernate 3.2.4.sp1
Reporter: John J. Genoese
Attachments: NonBusinessDate.java
@Id appears to cause suppression of TemporalType.DATE.
In the attached .java file, I've included two java.util.Date fields, one of which is marked with @Id. Both fields are marked with @Temporal(Timestamp.DATE). The @Id field gets generated as 'timestamp', and the non-Id field gets generated as 'date' (which is the desired outcome.
The .java file is attached. The output DDL is included here.
create table public.nonbusinessdate (
nbdate timestamp not null,
nbdate2 date not null,
primary key (nbdate),
unique (nbdate)
);
--
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, 5 months