Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [teneo] problem with composition link
[teneo] problem with composition link [message #108130] Thu, 24 January 2008 17:13 Go to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

Hi Martin and everybody

I'have a problem with an application I'm working on.
It uses GMF, teneo and hibernate
my application works well while doing association link.
but as soon as I use a composition link, a lots of problems arrived.


FIRST CASE : if I create for example a player inside a team, all goes well.
But if i try to drag and drop the player out of the team to cut the
composition link, no error is raised, my player seems to be out of the
team in my diagram, but when i see in database, my player don't exist
anymore, it has been deleted.

SECOND CASE : I create a team from one side.
I create a player for the other side without link.
I try then to drag and drop the player inside my team to create my
composition link.
When I save to commit in database, an error occured and session is closed.
here you can found my output to see trace .
I hope someone will see where is the problem to help me

1035725 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource -
Validating contents of resource
platform:/resource/test/db_test/teneo.ProtoTournoi approx. 0 will be
checked
1035725 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource - Found
0 errors
1035725 [main] DEBUG
org.eclipse.emf.teneo.hibernate.resource.HibernateResource - Saving
resource with uri: platform:/resource/test/db_test/teneo.ProtoTournoi
1035725 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
1035725 [main] DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC
connection
1035725 [main] DEBUG
org.hibernate.connection.DriverManagerConnectionProvider - total
checked-out connections: 0
1035725 [main] DEBUG
org.hibernate.connection.DriverManagerConnectionProvider - using pooled
JDBC connection, pool size: 0
1035725 [main] DEBUG org.hibernate.transaction.JDBCTransaction - current
autocommit status: false
1035725 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction
begin
1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener -
persistent instance of: ProtoTournoi.impl.TournoiImpl
1035741 [main] DEBUG
org.hibernate.event.def.DefaultSaveOrUpdateEventListener - ignoring
persistent instance
1035741 [main] DEBUG
org.hibernate.event.def.DefaultSaveOrUpdateEventListener - object already
associated with session: [Tournoi#1]
1035741 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener
- flushing session
1035741 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener
- processing flush-time cascades
1035741 [main] DEBUG org.hibernate.engine.Cascade - processing cascade
ACTION_SAVE_UPDATE for: Tournoi
1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
ACTION_SAVE_UPDATE for collection: Tournoi.joueur
1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
ACTION_SAVE_UPDATE for collection: Tournoi.joueur
1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans for
collection: Tournoi.joueur
1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphaned
entity instance: Joueur
1035741 [main] DEBUG org.hibernate.event.def.DefaultDeleteEventListener -
deleting a persistent instance
1035741 [main] DEBUG org.hibernate.event.def.DefaultDeleteEventListener -
deleting [Joueur#2]
1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache mode
to: GET
1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache mode
to: NORMAL
1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache mode
to: GET
1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache mode
to: NORMAL
1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting orphans
for collection: Tournoi.joueur
1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
ACTION_SAVE_UPDATE for collection: Tournoi.equipe
1035741 [main] DEBUG org.hibernate.engine.CascadingAction - cascading to
saveOrUpdate: Equipe
1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener -
persistent instance of: Equipe
1035741 [main] DEBUG
org.hibernate.event.def.DefaultSaveOrUpdateEventListener - ignoring
persistent instance
1035741 [main] DEBUG
org.hibernate.event.def.DefaultSaveOrUpdateEventListener - object already
associated with session: [Equipe#equipe]
1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
ACTION_SAVE_UPDATE for collection: Tournoi.equipe
1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans for
collection: Tournoi.equipe
1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting orphans
for collection: Tournoi.equipe
1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
ACTION_SAVE_UPDATE for collection: Tournoi.match
1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
ACTION_SAVE_UPDATE for collection: Tournoi.match
1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans for
collection: Tournoi.match
1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting orphans
for collection: Tournoi.match
1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
ACTION_SAVE_UPDATE for collection: Tournoi.championnat
1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
ACTION_SAVE_UPDATE for collection: Tournoi.championnat
1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans for
collection: Tournoi.championnat
1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting orphans
for collection: Tournoi.championnat
1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
ACTION_SAVE_UPDATE for collection: Tournoi.stade
1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
ACTION_SAVE_UPDATE for collection: Tournoi.stade
1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans for
collection: Tournoi.stade
1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting orphans
for collection: Tournoi.stade
1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
ACTION_SAVE_UPDATE for collection: Tournoi.ville
1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
ACTION_SAVE_UPDATE for collection: Tournoi.ville
1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans for
collection: Tournoi.ville
1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting orphans
for collection: Tournoi.ville
1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
ACTION_SAVE_UPDATE for collection: Tournoi.historique
1035741 [main] DEBUG org.hibernate.engine.CascadingAction - cascading to
saveOrUpdate: Historique
1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener -
persistent instance of: Historique
1035741 [main] DEBUG
org.hibernate.event.def.DefaultSaveOrUpdateEventListener - ignoring
persistent instance
1035741 [main] DEBUG
org.hibernate.event.def.DefaultSaveOrUpdateEventListener - object already
associated with session: [Historique#3]
1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
ACTION_SAVE_UPDATE for collection: Tournoi.historique
1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans for
collection: Tournoi.historique
1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting orphans
for collection: Tournoi.historique
1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
ACTION_SAVE_UPDATE for collection: Tournoi.participant
1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
ACTION_SAVE_UPDATE for collection: Tournoi.participant
1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans for
collection: Tournoi.participant
1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting orphans
for collection: Tournoi.participant
1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
ACTION_SAVE_UPDATE for collection: Tournoi.participer
1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
ACTION_SAVE_UPDATE for collection: Tournoi.participer
1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans for
collection: Tournoi.participer
1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting orphans
for collection: Tournoi.participer
1035741 [main] DEBUG org.hibernate.engine.Cascade - done processing
cascade ACTION_SAVE_UPDATE for: Tournoi
1035741 [main] DEBUG org.hibernate.engine.Cascade - processing cascade
ACTION_SAVE_UPDATE for: Equipe
1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
ACTION_SAVE_UPDATE for collection: Equipe.fairePartie
1035741 [main] DEBUG org.hibernate.engine.CascadingAction - cascading to
saveOrUpdate: Joueur
1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener -
deleted instance of: Joueur
1035741 [main] DEBUG
org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving
transient instance
1035741 [main] DEBUG org.hibernate.impl.SessionImpl - flushing to force
deletion of re-saved object: [Joueur#2]
1035741 [main] ERROR org.eclipse.emf.teneo.hibernate.HbMapperException -
Exception when saving resource ProtoTournoi
org.hibernate.ObjectDeletedException: deleted object would be re-saved by
cascade (remove deleted object from associations): [Joueur#2]
at org.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:1 014)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:165)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
at
org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:218)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
at
org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:296)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at
org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
at
org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at
org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:161)
at
org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:346)
at
org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:348)
at
ProtoTournoi.diagram.part.ProtoTournoiDocumentProvider.doSav eDocument(ProtoTournoiDocumentProvider.java:617)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider$1SaveOperation.execute(AbstractDoc umentProvider.java:596)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider$DocumentProviderOperation.run(Abst ractDocumentProvider.java:66)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider.executeOperation(AbstractDocumentP rovider.java:530)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider.saveDocument(AbstractDocumentProvi der.java:579)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.performSave(DiagramDocumentEditor.java:8 25)
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.doSave(DiagramDocumentEditor.java:646)
at org.eclipse.ui.internal.SaveableHelper$1.run(SaveableHelper. java:143)
at org.eclipse.ui.internal.SaveableHelper$4.run(SaveableHelper. java:266)
at
org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:369)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:313)
at
org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:758)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:755)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2451)
at
org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:274)
at
org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:253)
at
org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:148)
at org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1345)
at org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3202)
at
org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3215)
at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:73)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at
org.eclipse.jface.commands.ActionHandler.execute(ActionHandl er.java:119)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:475)
at
org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:429)
at
org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:165)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:821)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:879)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:568)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:126)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:114 1)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:975)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:971)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1285)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3772)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3672 )
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:291)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4351 )
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:22 65)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3291)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
1035741 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rollback
1035741 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rolled
back JDBC Connection
1035741 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction
completion
1035741 [main] DEBUG org.hibernate.jdbc.ConnectionManager - aggressively
releasing JDBC connection
1035741 [main] DEBUG org.hibernate.jdbc.ConnectionManager - releasing
JDBC connection [ (open PreparedStatements: 0, globally: 0) (open
ResultSets: 0, globally: 0)]
1035741 [main] DEBUG
org.hibernate.connection.DriverManagerConnectionProvider - returning
connection to pool, pool size: 1
1035741 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction
completion
1035741 [main] DEBUG org.hibernate.impl.SessionImpl - closing session
1035741 [main] DEBUG org.hibernate.jdbc.ConnectionManager - connection
already null in cleanup : no action
Re: [teneo] problem with composition link [message #108147 is a reply to message #108130] Thu, 24 January 2008 18:21 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Fred,
Possibly the problem (and workaround) is described here:
http://www.elver.org/hibernate/hibernate_details.html#cutpas te
the solution proposes annotations in the model, I would advice to set annotations in a separate xml
file because then you have one location where you can manage them. This is also described on the
elver.org website.

My feel is that the second case is also covered by/related to the above solution.

gr. Martin

fred wrote:
> Hi Martin and everybody
>
> I'have a problem with an application I'm working on.
> It uses GMF, teneo and hibernate
> my application works well while doing association link.
> but as soon as I use a composition link, a lots of problems arrived.
>
>
> FIRST CASE : if I create for example a player inside a team, all goes well.
> But if i try to drag and drop the player out of the team to cut the
> composition link, no error is raised, my player seems to be out of the
> team in my diagram, but when i see in database, my player don't exist
> anymore, it has been deleted.
>
> SECOND CASE : I create a team from one side. I create a player for the
> other side without link.
> I try then to drag and drop the player inside my team to create my
> composition link. When I save to commit in database, an error occured
> and session is closed.
> here you can found my output to see trace .
> I hope someone will see where is the problem to help me
>
> 1035725 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource -
> Validating contents of resource
> platform:/resource/test/db_test/teneo.ProtoTournoi approx. 0 will be
> checked
> 1035725 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource -
> Found 0 errors 1035725 [main] DEBUG
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource - Saving
> resource with uri: platform:/resource/test/db_test/teneo.ProtoTournoi
> 1035725 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
> 1035725 [main] DEBUG org.hibernate.jdbc.ConnectionManager - opening
> JDBC connection
> 1035725 [main] DEBUG
> org.hibernate.connection.DriverManagerConnectionProvider - total
> checked-out connections: 0
> 1035725 [main] DEBUG
> org.hibernate.connection.DriverManagerConnectionProvider - using pooled
> JDBC connection, pool size: 0
> 1035725 [main] DEBUG org.hibernate.transaction.JDBCTransaction -
> current autocommit status: false
> 1035725 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction
> begin
> 1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener
> - persistent instance of: ProtoTournoi.impl.TournoiImpl
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - ignoring
> persistent instance
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - object
> already associated with session: [Tournoi#1]
> 1035741 [main] DEBUG
> org.hibernate.event.def.AbstractFlushingEventListener - flushing session
> 1035741 [main] DEBUG
> org.hibernate.event.def.AbstractFlushingEventListener - processing
> flush-time cascades
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - processing cascade
> ACTION_SAVE_UPDATE for: Tournoi
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.joueur
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.joueur
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.joueur
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphaned
> entity instance: Joueur
> 1035741 [main] DEBUG org.hibernate.event.def.DefaultDeleteEventListener
> - deleting a persistent instance
> 1035741 [main] DEBUG org.hibernate.event.def.DefaultDeleteEventListener
> - deleting [Joueur#2]
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache
> mode to: GET
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache
> mode to: NORMAL
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache
> mode to: GET
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache
> mode to: NORMAL
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.joueur
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.equipe
> 1035741 [main] DEBUG org.hibernate.engine.CascadingAction - cascading
> to saveOrUpdate: Equipe
> 1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener
> - persistent instance of: Equipe
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - ignoring
> persistent instance
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - object
> already associated with session: [Equipe#equipe]
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.equipe
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.equipe
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.equipe
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.match
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.match
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.match
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.match
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.championnat
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.championnat
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.championnat
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.championnat
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.stade
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.stade
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.stade
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.stade
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.ville
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.ville
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.ville
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.ville
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.historique
> 1035741 [main] DEBUG org.hibernate.engine.CascadingAction - cascading
> to saveOrUpdate: Historique
> 1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener
> - persistent instance of: Historique
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - ignoring
> persistent instance
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - object
> already associated with session: [Historique#3]
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.historique
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.historique
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.historique
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.participant
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.participant
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.participant
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.participant
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.participer
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.participer
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.participer
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.participer
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done processing
> cascade ACTION_SAVE_UPDATE for: Tournoi
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - processing cascade
> ACTION_SAVE_UPDATE for: Equipe
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Equipe.fairePartie
> 1035741 [main] DEBUG org.hibernate.engine.CascadingAction - cascading
> to saveOrUpdate: Joueur
> 1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener
> - deleted instance of: Joueur
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving
> transient instance
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - flushing to force
> deletion of re-saved object: [Joueur#2]
> 1035741 [main] ERROR org.eclipse.emf.teneo.hibernate.HbMapperException
> - Exception when saving resource ProtoTournoi
> org.hibernate.ObjectDeletedException: deleted object would be re-saved
> by cascade (remove deleted object from associations): [Joueur#2]
> at org.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:1 014)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:165)
>
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>
> at
> org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
> at
> org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:218)
> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
> at
> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:296)
> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
>
> at
> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
>
> at
> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
>
> at
> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
>
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:161)
>
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:346)
>
> at
> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:348)
> at
> ProtoTournoi.diagram.part.ProtoTournoiDocumentProvider.doSav eDocument(ProtoTournoiDocumentProvider.java:617)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider$1SaveOperation.execute(AbstractDoc umentProvider.java:596)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider$DocumentProviderOperation.run(Abst ractDocumentProvider.java:66)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider.executeOperation(AbstractDocumentP rovider.java:530)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider.saveDocument(AbstractDocumentProvi der.java:579)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.performSave(DiagramDocumentEditor.java:8 25)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.doSave(DiagramDocumentEditor.java:646)
>
> at
> org.eclipse.ui.internal.SaveableHelper$1.run(SaveableHelper. java:143)
> at
> org.eclipse.ui.internal.SaveableHelper$4.run(SaveableHelper. java:266)
> at
> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:369)
>
> at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:313)
> at
> org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:758)
>
> at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
> at
> org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:755)
> at
> org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2451)
> at
> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:274)
>
> at
> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:253)
>
> at
> org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:148)
> at
> org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1345)
> at
> org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3202)
> at
> org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3215)
> at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:73)
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
> at
> org.eclipse.jface.commands.ActionHandler.execute(ActionHandl er.java:119)
> at
> org.eclipse.core.commands.Command.executeWithChecks(Command. java:475)
> at
> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:429)
>
> at
> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:165)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:821)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:879)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:568)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:126)
>
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> at org.eclipse.swt.widgets.Display.filterEvent(Display.java:114 1)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:975)
> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:971)
> at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1285)
> at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3772)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:3672 )
> at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:291)
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4351 )
> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:22 65)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3291)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
> 1035741 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rollback
> 1035741 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rolled
> back JDBC Connection
> 1035741 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction
> completion
> 1035741 [main] DEBUG org.hibernate.jdbc.ConnectionManager -
> aggressively releasing JDBC connection
> 1035741 [main] DEBUG org.hibernate.jdbc.ConnectionManager - releasing
> JDBC connection [ (open PreparedStatements: 0, globally: 0) (open
> ResultSets: 0, globally: 0)]
> 1035741 [main] DEBUG
> org.hibernate.connection.DriverManagerConnectionProvider - returning
> connection to pool, pool size: 1
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction
> completion
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - closing session
> 1035741 [main] DEBUG org.hibernate.jdbc.ConnectionManager - connection
> already null in cleanup : no action
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [teneo] problem with composition link [message #108197 is a reply to message #108147] Fri, 25 January 2008 14:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

Thank's for informations ;-)

I'm watching to all this but I don't see where (in teneo tutorial) I can
do modifications to take this into account:
persistenceOptions.SET_CASCADE_ALL_ON_CONTAINMENT to false
Re: [teneo] problem with composition link [message #108209 is a reply to message #108197] Fri, 25 January 2008 14:33 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
These settings can only be used if you programmatically generate the hbm file. You can do this using
the HbHelper instance (see the relevant static methods there):
http://www.elver.org/hibernate/hbdatastore.html#Getting+the+ Hibernate+Mapping+XML

Btw, Teneo also works fine if you don't generate a hbm file, it will generate an in-. My preferred
way of working is to not use a hbm file but do all the changes in a separate annotations xml file.

gr. Martin

fred wrote:
> Thank's for informations ;-)
>
> I'm watching to all this but I don't see where (in teneo tutorial) I can
> do modifications to take this into account:
> persistenceOptions.SET_CASCADE_ALL_ON_CONTAINMENT to false
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [teneo] problem with composition link [message #108225 is a reply to message #108209] Fri, 25 January 2008 14:34 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
(re-posted to complete a sentence)

These settings can only be used if you programmatically generate the hbm
file. You can do this using the HbHelper instance (see the relevant
static methods there):
http://www.elver.org/hibernate/hbdatastore.html#Getting+the+ Hibernate+Mapping+XML

Btw, Teneo also works fine if you don't generate a hbm file, it will
generate an in-memory mapping. My preferred way of working is to not use a hbm file
but do all the changes in a separate annotations xml file.

gr. Martin

fred wrote:
>> Thank's for informations ;-)
>>
>> I'm watching to all this but I don't see where (in teneo tutorial) I
>> can do modifications to take this into account:
>> persistenceOptions.SET_CASCADE_ALL_ON_CONTAINMENT to false
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [teneo] problem with composition link [message #108266 is a reply to message #108225] Fri, 25 January 2008 15:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic.ventura.eurogiciel.fr

Ok I've done my xml file like this (it is called test.persistence.xml):

<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE persistence-mapping
PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd">
<persistence-mapping xmlns="http://www.eclipse.org/emft/teneo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Template for ProtoTournoi persistence mapping. -->
<epackage namespace-uri="ProtoTournoi">
<eclass name="Team">
<property name="players">
<one-to-many>
<cascade>MERGE</cascade>
<cascade>PERSIST</cascade>
<cascade>REFRESH</cascade>
<cascade>REMOVE</cascade>
</one-to-many>
</property>
</eclass>
</epackage>
</persistence-mapping>

But I don't see what I have to do to take it into account?
Re: [teneo] problem with composition link [message #108278 is a reply to message #108266] Fri, 25 January 2008 16:06 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
See here:
http://www.elver.org/hibernate/ejb3_format.html#xml

gr. Martin

fred wrote:
> Ok I've done my xml file like this (it is called test.persistence.xml):
>
> <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE persistence-mapping
> PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd">
> <persistence-mapping xmlns="http://www.eclipse.org/emft/teneo"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <!-- Template for ProtoTournoi persistence mapping. -->
> <epackage namespace-uri="ProtoTournoi">
> <eclass name="Team">
> <property name="players">
> <one-to-many>
> <cascade>MERGE</cascade>
> <cascade>PERSIST</cascade>
> <cascade>REFRESH</cascade>
> <cascade>REMOVE</cascade>
> </one-to-many>
> </property>
> </eclass>
> </epackage>
> </persistence-mapping>
>
> But I don't see what I have to do to take it into account?
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [teneo] problem with composition link [message #614080 is a reply to message #108130] Thu, 24 January 2008 18:21 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Fred,
Possibly the problem (and workaround) is described here:
http://www.elver.org/hibernate/hibernate_details.html#cutpas te
the solution proposes annotations in the model, I would advice to set annotations in a separate xml
file because then you have one location where you can manage them. This is also described on the
elver.org website.

My feel is that the second case is also covered by/related to the above solution.

gr. Martin

fred wrote:
> Hi Martin and everybody
>
> I'have a problem with an application I'm working on.
> It uses GMF, teneo and hibernate
> my application works well while doing association link.
> but as soon as I use a composition link, a lots of problems arrived.
>
>
> FIRST CASE : if I create for example a player inside a team, all goes well.
> But if i try to drag and drop the player out of the team to cut the
> composition link, no error is raised, my player seems to be out of the
> team in my diagram, but when i see in database, my player don't exist
> anymore, it has been deleted.
>
> SECOND CASE : I create a team from one side. I create a player for the
> other side without link.
> I try then to drag and drop the player inside my team to create my
> composition link. When I save to commit in database, an error occured
> and session is closed.
> here you can found my output to see trace .
> I hope someone will see where is the problem to help me
>
> 1035725 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource -
> Validating contents of resource
> platform:/resource/test/db_test/teneo.ProtoTournoi approx. 0 will be
> checked
> 1035725 [main] DEBUG org.eclipse.emf.teneo.resource.StoreResource -
> Found 0 errors 1035725 [main] DEBUG
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource - Saving
> resource with uri: platform:/resource/test/db_test/teneo.ProtoTournoi
> 1035725 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
> 1035725 [main] DEBUG org.hibernate.jdbc.ConnectionManager - opening
> JDBC connection
> 1035725 [main] DEBUG
> org.hibernate.connection.DriverManagerConnectionProvider - total
> checked-out connections: 0
> 1035725 [main] DEBUG
> org.hibernate.connection.DriverManagerConnectionProvider - using pooled
> JDBC connection, pool size: 0
> 1035725 [main] DEBUG org.hibernate.transaction.JDBCTransaction -
> current autocommit status: false
> 1035725 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction
> begin
> 1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener
> - persistent instance of: ProtoTournoi.impl.TournoiImpl
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - ignoring
> persistent instance
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - object
> already associated with session: [Tournoi#1]
> 1035741 [main] DEBUG
> org.hibernate.event.def.AbstractFlushingEventListener - flushing session
> 1035741 [main] DEBUG
> org.hibernate.event.def.AbstractFlushingEventListener - processing
> flush-time cascades
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - processing cascade
> ACTION_SAVE_UPDATE for: Tournoi
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.joueur
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.joueur
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.joueur
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphaned
> entity instance: Joueur
> 1035741 [main] DEBUG org.hibernate.event.def.DefaultDeleteEventListener
> - deleting a persistent instance
> 1035741 [main] DEBUG org.hibernate.event.def.DefaultDeleteEventListener
> - deleting [Joueur#2]
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache
> mode to: GET
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache
> mode to: NORMAL
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache
> mode to: GET
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - setting cache
> mode to: NORMAL
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.joueur
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.equipe
> 1035741 [main] DEBUG org.hibernate.engine.CascadingAction - cascading
> to saveOrUpdate: Equipe
> 1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener
> - persistent instance of: Equipe
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - ignoring
> persistent instance
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - object
> already associated with session: [Equipe#equipe]
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.equipe
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.equipe
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.equipe
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.match
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.match
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.match
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.match
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.championnat
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.championnat
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.championnat
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.championnat
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.stade
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.stade
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.stade
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.stade
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.ville
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.ville
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.ville
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.ville
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.historique
> 1035741 [main] DEBUG org.hibernate.engine.CascadingAction - cascading
> to saveOrUpdate: Historique
> 1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener
> - persistent instance of: Historique
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - ignoring
> persistent instance
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - object
> already associated with session: [Historique#3]
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.historique
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.historique
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.historique
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.participant
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.participant
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.participant
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.participant
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.participer
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done cascade
> ACTION_SAVE_UPDATE for collection: Tournoi.participer
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - deleting orphans
> for collection: Tournoi.participer
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done deleting
> orphans for collection: Tournoi.participer
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - done processing
> cascade ACTION_SAVE_UPDATE for: Tournoi
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - processing cascade
> ACTION_SAVE_UPDATE for: Equipe
> 1035741 [main] DEBUG org.hibernate.engine.Cascade - cascade
> ACTION_SAVE_UPDATE for collection: Equipe.fairePartie
> 1035741 [main] DEBUG org.hibernate.engine.CascadingAction - cascading
> to saveOrUpdate: Joueur
> 1035741 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener
> - deleted instance of: Joueur
> 1035741 [main] DEBUG
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving
> transient instance
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - flushing to force
> deletion of re-saved object: [Joueur#2]
> 1035741 [main] ERROR org.eclipse.emf.teneo.hibernate.HbMapperException
> - Exception when saving resource ProtoTournoi
> org.hibernate.ObjectDeletedException: deleted object would be re-saved
> by cascade (remove deleted object from associations): [Joueur#2]
> at org.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:1 014)
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent ityIsTransient(DefaultSaveOrUpdateEventListener.java:165)
>
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.per formSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
>
> at
> org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS aveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
>
> at
> org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl. java:507)
> at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java :499)
> at
> org.hibernate.engine.CascadingAction$5.cascade(CascadingActi on.java:218)
> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
> at
> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:296)
> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.cascad eOnFlush(AbstractFlushingEventListener.java:131)
>
> at
> org.hibernate.event.def.AbstractFlushingEventListener.prepar eEntityFlushes(AbstractFlushingEventListener.java:122)
>
> at
> org.hibernate.event.def.AbstractFlushingEventListener.flushE verythingToExecutions(AbstractFlushingEventListener.java:65)
>
> at
> org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:26)
>
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSes sionWrapper.java:161)
>
> at
> org.eclipse.emf.teneo.hibernate.resource.HibernateResource.s aveResource(HibernateResource.java:346)
>
> at
> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:348)
> at
> ProtoTournoi.diagram.part.ProtoTournoiDocumentProvider.doSav eDocument(ProtoTournoiDocumentProvider.java:617)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider$1SaveOperation.execute(AbstractDoc umentProvider.java:596)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider$DocumentProviderOperation.run(Abst ractDocumentProvider.java:66)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider.executeOperation(AbstractDocumentP rovider.java:530)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .AbstractDocumentProvider.saveDocument(AbstractDocumentProvi der.java:579)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.performSave(DiagramDocumentEditor.java:8 25)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.doSave(DiagramDocumentEditor.java:646)
>
> at
> org.eclipse.ui.internal.SaveableHelper$1.run(SaveableHelper. java:143)
> at
> org.eclipse.ui.internal.SaveableHelper$4.run(SaveableHelper. java:266)
> at
> org.eclipse.jface.operation.ModalContext.runInCurrentThread( ModalContext.java:369)
>
> at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:313)
> at
> org.eclipse.jface.window.ApplicationWindow$1.run(Application Window.java:758)
>
> at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
> at
> org.eclipse.jface.window.ApplicationWindow.run(ApplicationWi ndow.java:755)
> at
> org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow. java:2451)
> at
> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:274)
>
> at
> org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOpe ration(SaveableHelper.java:253)
>
> at
> org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelp er.java:148)
> at
> org.eclipse.ui.internal.EditorManager.savePart(EditorManager .java:1345)
> at
> org.eclipse.ui.internal.WorkbenchPage.savePart(WorkbenchPage .java:3202)
> at
> org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPa ge.java:3215)
> at org.eclipse.ui.internal.SaveAction.run(SaveAction.java:73)
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
> at
> org.eclipse.jface.commands.ActionHandler.execute(ActionHandl er.java:119)
> at
> org.eclipse.core.commands.Command.executeWithChecks(Command. java:475)
> at
> org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:429)
>
> at
> org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:165)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:821)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:879)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:568)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
>
> at
> org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:126)
>
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> at org.eclipse.swt.widgets.Display.filterEvent(Display.java:114 1)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:947)
> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:975)
> at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:971)
> at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1285)
> at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3772)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:3672 )
> at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:291)
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4351 )
> at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
> at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:22 65)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3291)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
> at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
> 1035741 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rollback
> 1035741 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rolled
> back JDBC Connection
> 1035741 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction
> completion
> 1035741 [main] DEBUG org.hibernate.jdbc.ConnectionManager -
> aggressively releasing JDBC connection
> 1035741 [main] DEBUG org.hibernate.jdbc.ConnectionManager - releasing
> JDBC connection [ (open PreparedStatements: 0, globally: 0) (open
> ResultSets: 0, globally: 0)]
> 1035741 [main] DEBUG
> org.hibernate.connection.DriverManagerConnectionProvider - returning
> connection to pool, pool size: 1
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction
> completion
> 1035741 [main] DEBUG org.hibernate.impl.SessionImpl - closing session
> 1035741 [main] DEBUG org.hibernate.jdbc.ConnectionManager - connection
> already null in cleanup : no action
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [teneo] problem with composition link [message #614083 is a reply to message #108147] Fri, 25 January 2008 14:18 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
Thank's for informations ;-)

I'm watching to all this but I don't see where (in teneo tutorial) I can
do modifications to take this into account:
persistenceOptions.SET_CASCADE_ALL_ON_CONTAINMENT to false
Re: [teneo] problem with composition link [message #614084 is a reply to message #108197] Fri, 25 January 2008 14:33 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
These settings can only be used if you programmatically generate the hbm file. You can do this using
the HbHelper instance (see the relevant static methods there):
http://www.elver.org/hibernate/hbdatastore.html#Getting+the+ Hibernate+Mapping+XML

Btw, Teneo also works fine if you don't generate a hbm file, it will generate an in-. My preferred
way of working is to not use a hbm file but do all the changes in a separate annotations xml file.

gr. Martin

fred wrote:
> Thank's for informations ;-)
>
> I'm watching to all this but I don't see where (in teneo tutorial) I can
> do modifications to take this into account:
> persistenceOptions.SET_CASCADE_ALL_ON_CONTAINMENT to false
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [teneo] problem with composition link [message #614085 is a reply to message #108209] Fri, 25 January 2008 14:34 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
(re-posted to complete a sentence)

These settings can only be used if you programmatically generate the hbm
file. You can do this using the HbHelper instance (see the relevant
static methods there):
http://www.elver.org/hibernate/hbdatastore.html#Getting+the+ Hibernate+Mapping+XML

Btw, Teneo also works fine if you don't generate a hbm file, it will
generate an in-memory mapping. My preferred way of working is to not use a hbm file
but do all the changes in a separate annotations xml file.

gr. Martin

fred wrote:
>> Thank's for informations ;-)
>>
>> I'm watching to all this but I don't see where (in teneo tutorial) I
>> can do modifications to take this into account:
>> persistenceOptions.SET_CASCADE_ALL_ON_CONTAINMENT to false
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [teneo] problem with composition link [message #614088 is a reply to message #108225] Fri, 25 January 2008 15:59 Go to previous message
fred is currently offline fredFriend
Messages: 35
Registered: July 2009
Member
Ok I've done my xml file like this (it is called test.persistence.xml):

<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE persistence-mapping
PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd">
<persistence-mapping xmlns="http://www.eclipse.org/emft/teneo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Template for ProtoTournoi persistence mapping. -->
<epackage namespace-uri="ProtoTournoi">
<eclass name="Team">
<property name="players">
<one-to-many>
<cascade>MERGE</cascade>
<cascade>PERSIST</cascade>
<cascade>REFRESH</cascade>
<cascade>REMOVE</cascade>
</one-to-many>
</property>
</eclass>
</epackage>
</persistence-mapping>

But I don't see what I have to do to take it into account?
Re: [teneo] problem with composition link [message #614089 is a reply to message #108266] Fri, 25 January 2008 16:06 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
See here:
http://www.elver.org/hibernate/ejb3_format.html#xml

gr. Martin

fred wrote:
> Ok I've done my xml file like this (it is called test.persistence.xml):
>
> <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE persistence-mapping
> PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "document-v13.dtd">
> <persistence-mapping xmlns="http://www.eclipse.org/emft/teneo"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <!-- Template for ProtoTournoi persistence mapping. -->
> <epackage namespace-uri="ProtoTournoi">
> <eclass name="Team">
> <property name="players">
> <one-to-many>
> <cascade>MERGE</cascade>
> <cascade>PERSIST</cascade>
> <cascade>REFRESH</cascade>
> <cascade>REMOVE</cascade>
> </one-to-many>
> </property>
> </eclass>
> </epackage>
> </persistence-mapping>
>
> But I don't see what I have to do to take it into account?
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:[Teneo] Enhancing the ECore classes
Next Topic:[Temporality][CDO][Teneo]Delegating EStore and Root extends class
Goto Forum:
  


Current Time: Sun Sep 20 03:26:57 GMT 2020

Powered by FUDForum. Page generated in 0.02307 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top