I'm glad to know that liftweb works with hibernate.
In hibernate to map a class all that is necessary is to write one xml (or put annotations in the class).
In GORM they improved because they use defaults for the mappings:
class DomainClass {
int someIntProperty
boolean someBooleanProperty
}
but if you need to change any of the default behavior all you need is to provide it. Suppose I need to change something (for example the table name), all I need to do is
class DomainClass {
int someIntProperty
boolean someBooleanProperty
static mapping = {
table 'table_name'
}
}
In GORM make it even more simpler because they add to domain class some handy methods to interface with hibernate , it's not necessary to use any Session/EntityManager (thanks to the dynamic features in groovy).
This simplicity doesn't add any restrictions to what I can do. This is what I like in hibernate. This is what I like in GORM.
This could be a good solution for simple projects but difference of simplicity betwen using hibernate and an ad hoc implementation of an object-relational mapping framework is not worthy in my projects to make me accept the lack of flexibility in the more complex situations.
This is not a issue of the implementations, but a design choice between Active Record (more simple and less flexible) and Data Mapper (can be more complex but it is more flexible).
IMHO hibernate is powerful and simple enough, but if anything better than hibernate appears in the horizon, it will be really interesting to see. (In 2004, I tested use prevalence of objects for simple projects instead using relational database, but I realized that was much simpler use hibernate with hsqldb than using prevayler with jxpath (instead sql) to make the queries.)
Could you provide links to the documentation/examples of liftweb using hibernate, please?
It will be really nice to test liftweb with hibernate.
Liftweb with Hibernate
David,
I'm glad to know that liftweb works with hibernate.
In hibernate to map a class all that is necessary is to write one xml (or put annotations in the class).
In GORM they improved because they use defaults for the mappings:
class DomainClass {
int someIntProperty
boolean someBooleanProperty
}
but if you need to change any of the default behavior all you need is to provide it. Suppose I need to change something (for example the table name), all I need to do is
class DomainClass {
int someIntProperty
boolean someBooleanProperty
static mapping = {
table 'table_name'
}
}
In GORM make it even more simpler because they add to domain class some handy methods to interface with hibernate , it's not necessary to use any Session/EntityManager (thanks to the dynamic features in groovy).
This simplicity doesn't add any restrictions to what I can do. This is what I like in hibernate. This is what I like in GORM.
This could be a good solution for simple projects but difference of simplicity betwen using hibernate and an ad hoc implementation of an object-relational mapping framework is not worthy in my projects to make me accept the lack of flexibility in the more complex situations.
This is not a issue of the implementations, but a design choice between Active Record (more simple and less flexible) and Data Mapper (can be more complex but it is more flexible).
IMHO hibernate is powerful and simple enough, but if anything better than hibernate appears in the horizon, it will be really interesting to see. (In 2004, I tested use prevalence of objects for simple projects instead using relational database, but I realized that was much simpler use hibernate with hsqldb than using prevayler with jxpath (instead sql) to make the queries.)
Could you provide links to the documentation/examples of liftweb using hibernate, please?
It will be really nice to test liftweb with hibernate.
Thanks for your work in liftweb,
Jonas Fagundes