Page 1 of 1
Using hibernate in Extension for Database Access?
Posted: Wed Mar 16, 2011 7:03 pm
by raff_nix
Hello,
i'm inventing an extension for OpenOffice and want to access to a database with hibernate. But if i try this, I get a hibernate Exception: /hibernate.cfg.xml not found.
I have the hibernate.cfg.xml file in the src path, but when i deploy the extension in OpenOffice, i get this error message. Any ideas, what can i do, to use hibernate in extension developement?
Re: Using hibernate in Extension for Database Access?
Posted: Fri Mar 18, 2011 8:06 pm
by raff_nix
Hello,
no help?

Re: Using hibernate in Extension for Database Access?
Posted: Fri Mar 18, 2011 8:33 pm
by r4zoli
No help, because not so much user use hiberbate.
I have no experience with hibernate eighter.
odb files not reachable from outside.
Only thing what you can do extract odb file with zipper, start hsqldb server with odb file scripts and data and use hibernate.
When you finished work repack back all files to odb file, which you can use later in OOo Base.
Re: Using hibernate in Extension for Database Access?
Posted: Fri Mar 18, 2011 9:48 pm
by hol.sten
raff_nix wrote:no help?

Me neither, I think. I once wrote an OOo Java macro example which uses several JAR files (for example mail.jar and log4j-1.2.16.jar) and properties files (log4j.properties and mail.properties) and called that from OOo as a macro, as you can read here:
http://user.services.openoffice.org/en/ ... =45&t=3813. Although I never used Hibernate in such an OOo Java macro, I suppose that configuring the classpath in the necessary parcel-descriptor.xml could be extended for a usage with Hibernate. But I never gave writing an extension a try so I think that my OOo Java macro knowledge cannot help you in your situation.
Re: Using hibernate in Extension for Database Access?
Posted: Sat Mar 19, 2011 4:34 pm
by raff_nix
Hello,
i think the problem is, that i have to change the build-uno.xml or the ant script, but i dont't know how to add my hibernate.cfg.xml file to the extension, so that is linked into the OXT-File Extension...?

Hibernate isnt't the problem...
Any ideas?
Re: Using hibernate in Extension for Database Access?
Posted: Sat Mar 19, 2011 8:43 pm
by r4zoli
The extensions genaral information, you could find in OOo wiki page:
http://wiki.services.openoffice.org/wiki/Extensions
But, extensions helps only in packaging your codes.
First you needs to know where to connect and how to connect into OOo, and how it works, where developer guide helps:
http://wiki.services.openoffice.org/wik ... n/DevGuide
Re: Using hibernate in Extension for Database Access?
Posted: Tue Mar 22, 2011 5:41 pm
by raff_nix
I have looked but i havent't found the needed information. Nothing about using hibernate with openoffice...

Re: Using hibernate in Extension for Database Access?
Posted: Tue Mar 22, 2011 8:00 pm
by r4zoli
As I mentioned in my first post no such information.
Why do you you think that you could use hibernate with OOo?
What scenario you try to use such pair?
Re: Using hibernate in Extension for Database Access?
Posted: Tue Mar 22, 2011 10:54 pm
by raff_nix
I generate with my Plugin a pdf and xml file. And these generated files i want to store in an arbitrary database. Thats all

Re: Using hibernate in Extension for Database Access?
Posted: Wed Mar 23, 2011 2:38 pm
by r4zoli
Then use hibarnate with
HSQLBD 2.1 in server mode to store data or links to data (no reason to store big files in database, only links).
You could connect later to external hsqldb server with OOo Base to create reports, etc.
Re: Using hibernate in Extension for Database Access?
Posted: Wed Mar 23, 2011 3:38 pm
by raff_nix
Yes, but it has nothing to do with my problem, which database i use.
My hibernate.cfg.xml -file wasn't found in my extension. If this works i can use arbitrary databases independent of an engine...
Re: Using hibernate in Extension for Database Access?
Posted: Wed Mar 23, 2011 3:51 pm
by r4zoli
Forget OOo and extensions.
Re: Using hibernate in Extension for Database Access?
Posted: Thu Mar 24, 2011 12:09 am
by raff_nix
why? Because you don't understand my problem?

Re: Using hibernate in Extension for Database Access?
Posted: Thu Mar 24, 2011 8:33 am
by r4zoli
No.
If I understand your problem correctly, you tried to use OOo and hibernate parallel, and reach database with hibernate, opened file within Base, without using OOo API is not possible, only with hibernate.
Otherwise no reason to talk about extensions at all.
Re: Using hibernate in Extension for Database Access?
Posted: Thu Mar 24, 2011 4:00 pm
by rudolfo
Hm, okay this is the macro forum, not the Base forum. The extension might even be for Calc or Writer only.
The crucial point here is that hibernate is a framework or at least an application layer and OpenOffice with its UNO object is a Framework (although a very special one), as well. Please rethink about this constellation.
If pluggin in the hibernate framework/component into OOo doesn't work, you might well try it the other way round. Of course in that case it is surely not an extension anymore. And I would be another one who doesn't answer your question.
Next question: Are you sure that the "hibernate.cfg.xml" is part of hibernate? Sounds silly I know. Typically you say hibernate won't work without this file, so of course it is part of hibernate.
But still the xml file itself could be part of the application server in which hibernate is supposed to run. You get the point? If you replace the AS with OpenOffice it is not guaranteed that OpenOffice follows EJB3 (or whatever it is) standards.