All entries for Thursday 09 June 2005

June 09, 2005

Cool thing in eclipse!

So if you right click on a Unit Test in eclipse you can run it in the embedded test runner.

But I didn't realise that you can also click on a package and that will run all the unit tests in that package.

So, no more trying to figure out which unit test failed in ant and running one-by-one in eclipse!

Just right click on your unit-test package and run all your unit tests in eclipse :)

Hibernate one–to–one problems :(

So I have an object Content which has a ContentFetcher (strategy).

Ideally I would like to implement ContentFetcher as a dependant object of Content, but I can't for the following reasons:

– a Content's contentFetcher can change

– dependent objects cannot be polymorphic in hibernate

So I map it as a one-to-one (Content to ContentFetcher) with the primary key of ContentFetcher being the same as the primary key of Content.

Unfortunately when I try and assign a new ContentFetcher, Hibernate explodes because there are two instances of ContentFetcher with the same id, the old one and the new one. There seems to be no way to indicate to Hibernate (without explictly calling session.delete which I haven't tried) to ignore the old content.

In the end I mapped it as a many-to-one with a foreign key in Content :(

Oh well.

June 2005

Mo Tu We Th Fr Sa Su
May |  Today  | Jul
      1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30         

Search this blog



Most recent comments

  • Interesting… While I'm not completely convinced in such microbenchmarks, I'm pretty sure that 1ms … by Alexander Snaps on this entry
  • Hello. I bought the book yesterday. I was trying to find the source code for chapter 11 and chapter … by Suleman on this entry
  • by live mashup demo on this entry
  • Thanks mate ….. This blog was really helpful. by Maaz Hurzuk on this entry
  • Ty. Not directly helpful for my problem, but pointed me in the right direction. You will also get th… by Mike E. on this entry

Blog archive

Not signed in
Sign in

Powered by BlogBuilder