views:

8

answers:

0

Hi all,

I have an internal web application that updates a database schema equivalent to something like this:

cds (
  cd_id : primary key
  title : string
)

tracks (
  track_id : primary key
  title : string
)

cd_tracks (
  cd_id : references cds(cd_id)
  track_number : integer
  track_id : references tracks(track_id)
)

That is, a typical n-m relationship with order (i.e. a track can appear in 0..n CDs). It is highly convenient to provide a CD edit page which can update CD details, alter the track listing (i.e. add existing tracks to the cd, or create new tracks and add them to the CD) and editing the tracks. It would also be pretty desirable to be able to alter the order of tracks already added to the CD.

I would like an interface equivalent to a spreadsheet showing all tracks for a CD (in fact, previously they used Excel), with a single Save button at the bottom which saves all the editions they have performed (both to the cd, to the tracks and to the cd_tracks relationship).

I implemented a working first version of the interface (plain Java, servlets, JDBC and SQL), but it shows its wrinkles and I'd prefer to use a framework to simplify it.

I'm looking preferably for a Java solution. If that's impossible, I'd be willing to accept something that runs well inside a JVM (Jython, Django on Jython, JRuby, etc.). If there's nothing, and I need to stray away the JVM, I can evaluate that. Also, cost is a big issue (I do have preferences for Apache-licensed software, but that's a minor detail). Additionally, I would prefer not to use an ORM and use SQL (actually, to implement cleanly track reordering ideally I'd use deferrable constraints, which might not be widely supported in ORMs)- if I need an ORM, I would like to work reverse-engineering tables and doing as little manual work as possible. Finally, I'm picky and I'd like something that degrades gracefully without Javascript, RESTy, etc.

When I first implemented this I didn't find any framework that handled n-m ordered relationships OOB nicely, but I'm wondering if there's something out there (Django? Rails?) that implements this painlessly.

Cheers,

Alex