On 7/21/07, Robert Manning <rob...@gm...> wrote:
> On 7/21/07, Gerd Wagner <bir...@t-...> wrote:
> > First of all it would be great if this worked. The configuration stuff and
> > especially getSessionFactoryImpl() is really not that nice.
> >
> Agreed
>
> > Let me try to guess what you are thinking of: Today a SQuirreL Session has all
> > that is needed for the database side of a Hibernate connection. What would be
> > missing was the mappings as well as the mapped classes, right? So you would take
> > the Classpath the user provides to look for mappings (either xmls or
> > annotations) and would make Hibernate get to know these. Is this kind of the
> > direction you are thinking?
> >
> Exactly. At a minimal Hibernate Configuration needs:
>
> hibernate.connection.driver_class
> hibernate.connection.url
> hibernate.connection.username
> hibernate.connection.password
> hibernate.dialect
> mapping files or annotated class files (using hibernate-annotations)
>
> The dialect can be determined maybe with a new static method in DialectFactory.
> The mappings are provided by the user with the Hibernate plugin.
>
> I think the pieces are all there, it just implementation details that
> are unknown.
So I started to test out my idea and I hit a small obstacle - I knew
about this earlier but chose to forget it until later; later appears
to be now. The problem is that the SQuirreL HibernateDialect
framework that I devised was based on the Hibernate 3.0 API. The 3.2
API is slightly different with regard to Dialects. Since most users
will want to be using the latest Hibernate with the Hibernate plugin,
I've decided that the time is now to update the Dialects and pull down
the latest hibernate core. While I'm at it, it seems like a good idea
to also bring in the hibernate-annotations / hibernate-entitymanager
to be able to read mapping metadata from annotated classes
(entitymanager provides the JPA-specified ability to snarf all of the
mapping metadata from a jar file that contains annotated classes
amongst other non-entity classes). When I finish updating the
Hibernate libraries that get shipped with SQuirreL (and testing DBCopy
, Refactoring, and SQLScripts plugins for compatibitliy - sigh),
I'll try to further explore my idea for using ISession to help build
the hibernate Configuration object necessary to obtain a
SessionFactory.
Rob
|