[Hibernate-JIRA] Created: (ANN-681) @OneToOne Object references can't be used as @Id
by __dk__ (JIRA)
@OneToOne Object references can't be used as @Id
------------------------------------------------
Key: ANN-681
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-681
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.3.0.ga
Reporter: __dk__
Is this related to ANN-619, or is it in general impossible to use object refs as IDs? Don't know:
Dummy:
class B {
@Id
[... Generator ...]
long id;
}
This works:
class A {
@Id
long id;
@OneToOne(optional=false, fetch=FetchType.LAZY)
@JoinColumn(name="B_ID", nullable=false, updatable=false)
B b;
}
This doesn't:
class A {
@Id
@OneToOne(optional=false, fetch=FetchType.LAZY)
@JoinColumn(name="B_ID", nullable=false, updatable=false)
B b;
}
Output:
05:59:11 FATAL [artcollector.welt.Persistence] Exception:
org.hibernate.MappingException: Could not determine type for: test.B, for columns: [org.hibernate.mapping.Column(b_id)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
at org.hibernate.mapping.RootClass.validate(RootClass.java:193)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at test.Persistence.init(Persistence.java:33)
--
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
18 years, 4 months
[Hibernate-JIRA] Commented: (HHH-1341) Query.setMaxResults does not work with Mysql Connector version 3.1.6, but works with 3.0.14
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1341?page=c... ]
Diego Pires Plentz commented on HHH-1341:
-----------------------------------------
Please, could you give the hibernate 3.2.5ga(latest version) a try?
> Query.setMaxResults does not work with Mysql Connector version 3.1.6, but works with 3.0.14
> -------------------------------------------------------------------------------------------
>
> Key: HHH-1341
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1341
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1
> Environment: Hibernate 3.1, Mysql Server 4.1.3, Mysql Connector 3.1.6 bzw. 3.0.14, JRE 1.5.0_06, winxp
> Reporter: Stefan Reger
> Priority: Minor
>
> With Mysql Connector version 3.1.6: Setting query.setMaxResults(1000) results in console output:
> "Hibernate: select [...] limit ?
> 13:38:47,296 WARN JDBCExceptionReporter:71 - SQL Error: 1064, SQLState: 42000
> 13:38:47,296 ERROR JDBCExceptionReporter:72 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1"
> The query without setting the result limit succeeds.
> Mysql Connector 3.0.14 works perfectly. Please verify.
--
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
18 years, 4 months
[Hibernate-JIRA] Created: (HHH-2954) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException seting setMaxResults
by Ignacio Manzano (JIRA)
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException seting setMaxResults
------------------------------------------------------------------------------
Key: HHH-2954
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2954
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.1
Environment: MySQL 5.0 using JDBC Driver mysql-connector-java-5.1.5-bin.jar
Reporter: Ignacio Manzano
Priority: Blocker
When try to set setFirstResult or setMaxResults in a Criteria the following exception appear
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 10 10 this_.id as id3_0_, this_.title as title3_0_, this_.public as public' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.Util.getInstance(Util.java:381)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1031)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1888)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1778)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2211)
... 79 more
I tryed set up the following parameter in SQL String but doesn´t work
useServerPrepStmts=false
emulateUnsupportedPstmts=false
--
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
18 years, 4 months
[Hibernate-JIRA] Commented: (EJB-178) JarVisitor.getVisitor does not treat correctly paths with spaces
by Lars Francke (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-178?page=co... ]
Lars Francke commented on EJB-178:
----------------------------------
I am running into the same problem as Alexandrino and I have to say that it is very annoying during development as all my jars are coming from the Maven Repository directory (in the Documents and Settings directory) and I'm unable to start any of my projects this way.
> JarVisitor.getVisitor does not treat correctly paths with spaces
> ----------------------------------------------------------------
>
> Key: EJB-178
> URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-178
> Project: Hibernate Entity Manager
> Issue Type: Bug
> Components: EntityManager
> Affects Versions: 3.1.0.Beta8
> Environment: Windows XP Professional; Tomcat 5.5.17.
> Reporter: Alexandrino Lucas
> Original Estimate: 15 minutes
> Remaining Estimate: 15 minutes
>
> I'm using Hibernate Entity Manager with a WAR deployed on Tomcat 5.5.17, and I'm getting the following error:
> 11/05/2006 16:12:43 org.hibernate.ejb.packaging.FileZippedJarVisitor doProcessElements
> WARNING: Unable to find file (ignored): file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/[REST OMITTED]
> java.util.zip.ZipException: Access is denied
> at java.util.zip.ZipFile.open(Native Method)
> at java.util.zip.ZipFile.<init>(Unknown Source)
> at java.util.jar.JarFile.<init>(Unknown Source)
> at java.util.jar.JarFile.<init>(Unknown Source)
> at org.hibernate.ejb.packaging.FileZippedJarVisitor.doProcessElements(FileZippedJarVisitor.java:34)
> at org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:208)
> at org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:201)
> at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:183)
> at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
> at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
> [MORE...]
> Two strange things: 1) the directory exists; 2) Hibernate is treating the path as being part of a JAR file. I found the cause of the problem when analysing org.hibernate.ejb.packaging.JarVisitor.getVisitor(URL, Filter[]):
> File file = new File( jarUrl.getFile() );
> if ( file.isDirectory() ) {
> return new ExplodedJarVisitor( jarUrl, filters );
> }
> else {
> return new FileZippedJarVisitor( jarUrl, filters );
> }
> As my path has some spaces, jarUrl.getFile() returns "/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps/[REST OMITTED]", which is not a directory, because of the "%20"'s. The specification of the java.net.URL class says: "The URL class does not itself encode or decode any URL components according to the escaping mechanism defined in RFC2396. It is the responsibility of the caller to encode any fields, which need to be escaped prior to calling URL, and also to decode any escaped fields, that are returned from URL."
> Although I did not have the time to build the project with it, I think that jarUrl.toURI().getPath() would solve the problem. Here is a snippet to prove it:
> import java.io.File;
> import java.net.URL;
> public class Main
> {
> public static void main(
> String[] args )
> throws Exception
> {
> URL url = new URL(
> "file:///C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%205.5/webapps" );
> System.out.println( "url.getFile()" );
> System.out.println( url.getFile() );
> System.out.println( new File( url.getFile() ).isDirectory() );
> System.out.println();
> System.out.println();
> System.out.println();
> System.out.println( "url.toURI().getPath()" );
> System.out.println( url.toURI().getPath() );
> System.out.println( new File( url.toURI().getPath() ).isDirectory() );
> }
> }
--
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
18 years, 4 months
[Hibernate-JIRA] Created: (HHH-2959) Using Map causes unaltered relationships in cache to be flushed
by Aaron Luchko (JIRA)
Using Map causes unaltered relationships in cache to be flushed
---------------------------------------------------------------
Key: HHH-2959
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2959
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Environment: hibernate-3.2.1, hibernate-3.2.5, hibernate-annotations-3.2.1, hibernate-annotations-3.3.0.GA, multiple databases
Reporter: Aaron Luchko
Attachments: hibMapBug.zip
I've found an issue with associations involving Maps.
Essentially we save a number of entities with associations involving Maps, then save all our changes and commit.
Once everything is saved and committed we start a new transaction and make a trivial change, we save the altered object and the relationship defined via the Map is recreated for every entity still in the cache. With a large cache this becomes a significant performance concern as we're performing O()N database operations every time we commit a transaction.
At the end when one would expect to see
Final Save
01:07:31,341 DEBUG org.hibernate.SQL:401 - update Foo set description=? where id=?
instead the output is
Final Save
01:07:31,341 DEBUG org.hibernate.SQL:401 - update Foo set description=? where id=?
01:07:31,345 DEBUG org.hibernate.SQL:401 - delete from Foo_Bar where Foo_id=?
01:07:31,349 DEBUG org.hibernate.SQL:401 - delete from Foo_Bar where Foo_id=?
01:07:31,351 DEBUG org.hibernate.SQL:401 - delete from Foo_Bar where Foo_id=?
01:07:31,353 DEBUG org.hibernate.SQL:401 - insert into Foo_Bar (Foo_id, mapkey, bars_id) values (?, ?, ?)
01:07:31,353 DEBUG org.hibernate.SQL:401 - insert into Foo_Bar (Foo_id, mapkey, bars_id) values (?, ?, ?)
01:07:31,353 DEBUG org.hibernate.SQL:401 - insert into Foo_Bar (Foo_id, mapkey, bars_id) values (?, ?, ?)
--
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
18 years, 4 months