Hmmm ... According to
http://forum.hibernate.org/viewtopic.php?t=971930&highlight=inversejoincolumns+update
this post it's a Hibernate
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2292 bug . How
involved is it to change the version of Hibernate being used by Appfuse? Is
it as simple as changing the pom.xml line:
<hibernate.version>3.2.1.ga</hibernate.version>
to
<hibernate.version>3.2.2.ga</hibernate.version>
and then copying the jar to the Maven repository? I'll give it a try.
Bob
syg6 wrote:
>
> I am using Appfuse 2.0, Spring MVC, Hibernate.
>
> I have two POJOs, Application (as in a job application or form) and Place.
> I got this example straight out of the JPA Annotations Reference:
>
> Application.java
>
> @Entity
> @Table(name = "applications")
>
> private Set<Place> places;
>
> @ManyToMany(
> targetEntity=com.myco.myapp.model.Place.class,
> cascade={CascadeType.ALL},
> fetch = FetchType.EAGER
> )
> @JoinTable(
> name="applicationsplaces",
> [EMAIL PROTECTED](name="idApplication")},
> [EMAIL PROTECTED](name="idPlace")}
> )
> public Set<Place> getPlaces(){
> return places;
> }
>
> Place.java
> @Entity
> @Table(name = "places")
>
> @ManyToMany(
> cascade={CascadeType.ALL},
> mappedBy="places",
> targetEntity=Application.class
> )
> public Set<Application> getApplications() {
> return applications;
> }
>
> When I create a new Application and associate Places my table,
> applicationsplaces, is updated. But when I update an Application it is not
> updated. Looking at the generated SQL, when I create a new Application the
> following insert is done:
>
> insert into applicationsplaces (idApplication, idPlace) values (?, ?)
>
> No such insert is done when I update an Application. I've looked here,
> Hibernate forums, FAQs, you name it. This seems like Hibernate 101 to me,
> something that should be a no-brainer, even for a noob like me. But I
> can't find the problem.
>
> Anyone?
>
> Thanks,
> Bob
>
--
View this message in context:
http://www.nabble.com/Hibernate-ManyToMany-not-updating-collection-tf4428202s2369.html#a12632473
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]