[Helma-user] Is it possible to use SQL Queries directly without collections or mappings etc.?

Michael Platzer michael.platzer at knallgrau.at
Tue Jan 23 12:18:20 CET 2007


Hi,
> helma seems very interesting an offers many features, but  I have to admit,
> that I don't understand the concept of object-relational mapping. 
The main concepts are outlined here: http://helma.org/docs/guide/mapping/

Direct SQL-Statements are of course possible, but you would omit a lot 
of Helma's beauty and power then.

  var nrOfComments = (Story.getById(123)).creator.comments.count();

As soon as you did the 'nasty' part of wiring your HopObject-mappings to 
your db-model, you will see that your need for 'complex sql queries' 
will vanish. The  single helma line above could of course be written 
into a single SQL-statements, that joins three tables (stories, users, 
comments), but will definitely be harder to read.

Additionally, you will get a super-smart object caching mechanism ( 
http://helma.org/docs/howtos/77405/ ) for free. Helma knows 
automatically (i.e. without further configuration) when it needs to 
perform a SQL-query and when it can use its object cache (in case that 
Helma is the single instance that performs updates on the db).
> Probably you can give me some hints if helma is right for me or if there is
> an alternative.
>   
But even if I couldn't convince you to use Helma's object mapping, I 
think Helma is still the right choice for you. Since it brings two main 
components (Rhino + Jetty) , that you will definitely need in your 
setup, together in a solid, stable framework.

greets,
  michi



More information about the Helma-user mailing list