[Hibernate-JIRA] Created: (ANN-420) Unable to find physical table: File
by Ole Jørgen Aurebekk (JIRA)
Unable to find physical table: File
-----------------------------------
Key: ANN-420
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-420
Project: Hibernate Annotations
Type: Bug
Versions: 3.2.0.cr1
Environment: Hibernate 3.2.0 CR2, MSSQL 2000
Reporter: Ole Jørgen Aurebekk
Attachments: hibernate testcase.zip
As posted on the forum : ( http://forum.hibernate.org/viewtopic.php?t=963737 )
(Might be a duplicate of http://opensource.atlassian.com/projects/hibernate/browse/ANN-362 )
Attached is a minimized testcase (run FileFail).
-----------------------------
I'm converting a kind of complicated application to use hibernate+annotations for persistence. I'm stuck with the old classnames like "File" which creates some problems for me.
I can annotate it like this, avoiding reserved words conflicts :
@Entity
@Table(name = "`File`")
public class File ...
and it works nicely until I try to make a manytomany relation like this :
@ManyToMany(targetEntity=FileFolder.class )
@JoinTable(
name="File_FileFolder",
joinColumns={@JoinColumn(name="File_id")},
inverseJoinColumns={@JoinColumn(name="FileFolder_id")}
)
private List virtualFolders;
What happens is I get an exception when creating my session factory :
org.hibernate.MappingException: Unable to find physical table: File
at org.hibernate.cfg.Mappings.getLogicalTableName(Mappings.java:473)
at org.hibernate.cfg.Mappings.getLogicalTableName(Mappings.java:520)
at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:866)
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:527)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:468)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1049)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:302)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1205)
at HibernateSessionFactory.currentSession(HibernateSessionFactory.java:15)
at Filefail.main(Filefail.java:21)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Exception in thread "main" java.lang.NullPointerException
at HibernateSessionFactory.currentSession(HibernateSessionFactory.java:21)
at Filefail.main(Filefail.java:21)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
It seems the relation somehow makes Hibernate forget that my File-class is mapped to `File`...
--
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: (HB-1567) could not insert exception with db2
by olivier royo (JIRA)
could not insert exception with db2
------------------------------------
Key: HB-1567
URL: http://opensource.atlassian.com/projects/hibernate/browse/HB-1567
Project: Hibernate2
Type: Bug
Reporter: olivier royo
Hi, I'm getting this exception while using db2 . Everything works fine using mysql.
Is it a bug?
Is there an issue for this problem???
best regards.
ERROR - DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null
ERROR - Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert: [eserve.bco_ta_address]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1869)
at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2200)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:46)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:136)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:324)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
--
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] Resolved: (ANN-379) Map<Entity, Entity> fails due to unique constraint on map-key column
by Emmanuel Bernard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-379?page=all ]
Emmanuel Bernard resolved ANN-379:
----------------------------------
Fix Version: 3.2.0
Resolution: Fixed
Assign To: Emmanuel Bernard
Fixed, thanks for the test case.
> Map<Entity, Entity> fails due to unique constraint on map-key column
> ---------------------------------------------------------------------
>
> Key: ANN-379
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-379
> Project: Hibernate Annotations
> Type: Bug
> Components: binder
> Versions: 3.2.0.cr1
> Environment: hibernate-3.2.0.CR2, hibernate-annotations-3.2.0.CR1, jdk-1.5.0_07
> Reporter: Benjamin Bentmann
> Assignee: Emmanuel Bernard
> Fix For: 3.2.0
> Attachments: IndexedCollectionTest.java
>
>
> The current DDL statements for a true Map<Entity, Entity> produce a unique constraint on the map-key column. This effectively prevents multiple entities (hosting such a Map) from using the same map key.
> I tracked the problem down to org.hibernate.cfg.annotations.MapBinder and its method bindKeyFromAssociationTable, line 225. In case of an entity as the map-key, the code always sets the unique flag for the join-column...
> Attached is a slightly modified version of your own test case IndexedCollectionTest to reproduce the problem. The only change I made is located in the method testRealMap, adding just another Atmosphere with the same GasKey.
> For a more verbose problem description you might want to have a look at:
> http://forum.hibernate.org/viewtopic.php?t=961102
--
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