Nothing quite like answering your own posts. No chance for arguing ...

So I was reading 
http://www.nabble.com/Upgrading-to-hibernate-annotation-to-version-3.3.0.ga-tf4310306s2369.html#a12270648
this  thread about the Hibernate / Hibernate Annotations upgrade and decided
it was time to upgrade, to hopefully fix my original problem.

This is what I did:

1. mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate
-Dversion=3.2.5.ga -Dpackaging=jar
-Dfile=C:/downloads/hibernate/hibernate3.jar

2. mvn install:install-file -DgroupId=org.hibernate
-DartifactId=hibernate-annotations -Dversion=3.2.5.ga -Dpackaging=jar
-Dfile=C:/downloads/hibernate/hibernate-annotations.jar

3. mvn install:install-file -DgroupId=org.hibernate
-DartifactId=hibernate-entitymanager -Dversion=3.3.1.ga -Dpackaging=jar
-Dfile=C:/downloads/hibernate/hibernate-entitymanager.jar

4. Change the hibernate version in my pom.xml:
<hibernate.version>3.2.5.ga</hibernate.version>

All went well. But now when I run mvn jetty:run-war, both from within
Eclipse and on the command line, it's telling me it can't find
javax.persistence.*. It seems it is not finding persistence.jar, although
I've never had this problem before, and the jar exists. I've also tried
running mvn clean and then mvn -U and the same thing happens, it can't
compile my POJOs because it can't find javax.persistence. The persistence
jar is not one of the files upgraded when I run mvn -U so I don't know why
it would 'disappear'.

Anyone? I am stuck in Maven ... if not hell, limbo.

Bob


syg6 wrote:
> 
> 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#a12633605
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to