[Hibernate] Tools
Hello, At job we have decided to convert our application to Hibernate to solve some persistence issues that were previously done by hand (caching, lazy loading, outter-join and so on). An existing application is not really easy to convert but it's going pretty well. The first thing that was missing was to be able to create hbm.xml files. I tried class2hbm (and improved it a little) but it wasn't enough. So on my free time I've started a HbmGenerator that creates a hbm.xml file from the class, table and a field mapping between both. It currently goes pretty well. I can map normal fields, user types (that we use a lot) and tonigh I'll try to add associations. So I thought you might be interested to see this app (and possibly add it to the hibernate tool set). What do you think? On side of that, I'm also working on hibern8ide. My first improvement was to be able to save the configuration so that each time you reopen it you don't have to reload everything anymore. My next idea is to add auto-completion for the queries and to have real file management. Same question, do you want my collaboration on that? Lastly, I have a suggestion. It's about a problem I had today. In all our tables, we have a creation_date and an updating_date field. One is filled with sysdate when the insert is done and the other is filled with sysdate each time the record is updated. This is harcoded in the sql insert and update call. The java code never sees that. The problem is that it wasn't possible to do so with hibernate. We had to add a getCreatingDate() and so in our business object base class to handle this. Instead, what I would have like is to be able to do something like: So to be able to hardcode a value in the sql call. But perhaps you have a better idea? Thanks and happy new year (yeah... I still ain't had the time to tell everyone...), Henri
Re: [Hibernate] Tools
You are absolutly right, the classes are really poor information. However, they are containing so information that the tables doesn't. For instance, custom types are know only from the class. So the only way to generate a correct mapping for them is to use the class AND the table. Let say we have a Amnt ( two attributes Amnt.value, Amnt.ccy ). The only was to map it from a Player object to a Player table (two columns: SALARY, SALARY_CCY) is to use link Amnt.value and Amnt.ccy with their appropriate column. With that you will be able to generate: BTW, the only way to be sure you map the correct attribute name with the correct column is to have a link between the class and table. We are planning to use my mapping tool to convert all our business classes to hibernate (around 500 classes I think). It wasn't possible to do it with any other tool currently available without editing a lot the final result by hand. I didn't modify class2hbm mainly because there was class2hbm, db2hbm and so I thought a 3rd tool linking class was appropriate to fill a hole. Also I must confess I was too lazy and in a hurry to do the needed refactoring in class2hbm. If you think the goal of my tool reached class2hbm one, I look more into it. Possibly the 3 tools can be merged since mine does the link between the other two. "real file management" : Currently I'm saving the environment using the Preferences API. I think that it's fine until where will be too much .hbm.xml files to put all their paths in the registry. So I'm doing a real file Open, Save, Save as..., Recent files functionality. Henri - Original Message - From: "Max Rydahl Andersen" <[EMAIL PROTECTED]> To: "Henri Tremblay" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, January 20, 2004 10:05 PM Subject: Re: [Hibernate] Tools > Henri Tremblay wrote: > > > Hello, > > > > At job we have decided to convert our application to Hibernate to > > solve some persistence issues that were previously done by hand > > (caching, lazy loading, outter-join and so on). > > > > An existing application is not really easy to convert but it's going > > pretty well. The first thing that was missing was to be able to create > > hbm.xml files. I tried class2hbm (and improved it a little) but it > > wasn't enough. So on my free time I've started a HbmGenerator that > > creates a hbm.xml file from the class, table and a field mapping > > between both. It currently goes pretty well. I can map normal fields, > > user types (that we use a lot) and tonigh I'll try to add > > associations. So I thought you might be interested to see this app > > (and possibly add it to the hibernate tool set). What do you think? > > Sounds interesting - even though .class files are VERY poor on > information - thus the reason why we don't encourage usage of class2hbm, > because > you almost everytime need to hand-manipulate the generated hbm.xml files. > > But if you have improvements they are more than welcome - still I would > prefer that you could do it by improving class2hbm, but you probably got > some reasons for not to do it ? > > > > > On side of that, I'm also working on hibern8ide. My first improvement > > was to be able to save the configuration so that each time you reopen > > it you don't have to reload everything anymore. My next idea is to add > > auto-completion for the queries and to have real file management. Same > > question, do you want my collaboration on that? > > Sure, add patches to it on the JIRA and we will integrate them. > I must ask, what do you mean by "real file management" ? > > /max > > > --- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Tools
Yeah, we thought about that. I dismissed the idea because it was meaning to add 2 triggers for each table in the application. (and so far, we are not using triggers) One solution was to have it in the mapping so it can be generated. But that's not possible by itself. So that's why we just upgraded the base class. We don't want do generate java, we already have it. We need the hbm. In fact, all the current tools are awesome for a project that starts from scratch with hibernate. But there's not much support for project conversion from as far as I know. I'm trying to fill the hole. - Original Message - From: "Christian Bauer" <[EMAIL PROTECTED]> To: "Henri Tremblay" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, January 20, 2004 10:05 PM Subject: Re: [Hibernate] Tools > On 20 Jan (21:52), Henri Tremblay wrote: > > > An existing application is not really easy to convert but it's going pretty well. The first thing that was missing was to be able to create hbm.xml files. I tried class2hbm (and improved it a little) but it wasn't enough. So on my free time I've started a HbmGenerator that creates a hbm.xml file from the class, table and a field mapping between both. It currently goes pretty well. I can map normal fields, user types (that we use a lot) and tonigh I'll try to add associations. So I thought you might be interested to see this app (and possibly add it to the hibernate tool set). What do you think? > > Well, I think that the existing tools pretty much cover the same > functionality. I remember that the POJO CodeGenerator (hbm2java) could > need some help with the Velocity templates. > > > > > > > So to be able to hardcode a value in the sql call. But perhaps you have a better idea? > > Use a trigger? > > > --- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Tools
Yeah, that was looking nice at first sight. I should give it a shot to be sure of what it can do. I decided not to use it because I didn't like to have the mapping code in my java class and I was still having to type all the tags by hand. - Original Message - From: "Angel Aray" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 20, 2004 9:33 PM Subject: Re: [Hibernate] Tools > To create hbm.xml files automagiclly from classes you should really try > xdoclet. > > All new project at work are now done using xdoclet+hibernate and we still can > belive how much productivity we have gained from this combination. > > > Regards, > Angel Aray. > > > On Tuesday 20 January 2004 16:52, Henri Tremblay wrote: > > Hello, > > > > At job we have decided to convert our application to Hibernate to solve > > some persistence issues that were previously done by hand (caching, lazy > > loading, outter-join and so on). > > > > An existing application is not really easy to convert but it's going pretty > > well. The first thing that was missing was to be able to create hbm.xml > > files. I tried class2hbm (and improved it a little) but it wasn't enough. > > So on my free time I've started a HbmGenerator that creates a hbm.xml file > > from the class, table and a field mapping between both. It currently goes > > pretty well. I can map normal fields, user types (that we use a lot) and > > tonigh I'll try to add associations. So I thought you might be interested > > to see this app (and possibly add it to the hibernate tool set). What do > > you think? > > > > On side of that, I'm also working on hibern8ide. My first improvement was > > to be able to save the configuration so that each time you reopen it you > > don't have to reload everything anymore. My next idea is to add > > auto-completion for the queries and to have real file management. Same > > question, do you want my collaboration on that? > > > > Lastly, I have a suggestion. It's about a problem I had today. In all our > > tables, we have a creation_date and an updating_date field. One is filled > > with sysdate when the insert is done and the other is filled with sysdate > > each time the record is updated. This is harcoded in the sql insert and > > update call. The java code never sees that. The problem is that it wasn't > > possible to do so with hibernate. We had to add a getCreatingDate() and so > > in our business object base class to handle this. Instead, what I would > > have like is to be able to do something like: > > > > > > > > So to be able to hardcode a value in the sql call. But perhaps you have a > > better idea? > > > > Thanks and happy new year (yeah... I still ain't had the time to tell > > everyone...), Henri > > > --- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Tools
Yep, It doesn't handle objects. I tried it but had to modify too much code. And it's absolutly not usable when you have 300 tables. But it sounds promising. I would like to work a little bit on it is I had time. I currently need to focus on my mapper and hibern8ide. - Original Message - From: "Christian Bauer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 20, 2004 10:45 PM Subject: Re: [Hibernate] Tools > On 20 Jan (22:42), Henri Tremblay wrote: > > > But there's not much support for project conversion from as far as I know. > > I'm trying to fill the hole. > > Did you try Middlegen? > > > --- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Lazy components
IMHO, I've been doing a lot of mapping these days on a lot of classes and tables from different teams on my project. I've seen a lot of different mapping issues. And I agree, I don't think you need to mess the code to put lazy components. The only time I've been using components is in the case where you have a denormalized one-to-one association. By that I mean that you have a one-to-one association but you decide that it will be more efficient to put everything in the same table. However, you still have two java objects. One aggregating the other. I'm not using components for my value types (Amount, Quantity, Currency and so on) because I think it's a good practice to have them immutable so there are not setters. And I prefer no to map directly on fields. So I'm using custom types for them. That said, the benefit of having lazy loading on components will be to allow to load only a part of a db table row. The fields mapped in the component won't be selected by hibernate. From my point of view, selecting a little less fields in the same table will rarely provide a big performance gain. Especially if you then lazy load them later. If there's a real gain, you should have put them in another table anyway I think. Hope it helps you deciding, Henri P.S.: Just to be annoying, according to the way I'm using components, I'll find really useful to have HB-31 fixed instead of lazy components implemented :-) (yeah, I know, it might not be really funny to fix it, even with the available patch...) --- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Lazy components
No, you've written a patch for it but it was never applied from as far as I know. At least, the issue is still open and by looking at the code I've seen nothing handling it. Also, I'm not quite sure to understand your comment from 06/Dec/03 09:09 AM. about exceptions being thrown. The improvement is about being able to select between having a component: 1- Instantiated but with all properties at null 2- Not instantiated at all (null) When all properties of the component are null in the database. Is this what the patch is doing? - Original Message - From: "Emmanuel Bernard" <[EMAIL PROTECTED]> To: "'hibernate-devel'" <[EMAIL PROTECTED]> Sent: Wednesday, February 25, 2004 12:39 AM Subject: Re: [Hibernate] Lazy components > Henri Tremblay wrote: > > >P.S.: Just to be annoying, according to the way I'm using components, I'll > >find really useful to have HB-31 fixed instead of lazy components > >implemented :-) (yeah, I know, it might not be really funny to fix it, even > >with the available patch...) > > > > > Hum, I thought this one was applied. I did the dev a long time ago : it > should have been lost. > > > --- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
RE: [Hibernate] Lazy components
I think I can't agree more with everything you said. And I didn't know the thing about the database reading the complete row anyway. It makes vanish the last argument I can think of for component lazy loading. From: "Joshua Davis" <[EMAIL PROTECTED]> To: "'Henri Tremblay'" <[EMAIL PROTECTED]>,"'hibernate-devel'" <[EMAIL PROTECTED]> Subject: RE: [Hibernate] Lazy components Date: Wed, 25 Feb 2004 05:27:37 -0500 > -Original Message- > From: Henri Tremblay [mailto:[EMAIL PROTECTED] > Sent: Monday, February 23, 2004 5:26 PM > To: Joshua Davis; 'Gavin King'; 'hibernate-devel' > Subject: Re: [Hibernate] Lazy components [snip] > That said, the benefit of having lazy loading on components > will be to allow to load only a part of a db table row. The > fields mapped in the component won't be selected by > hibernate. The database might read the row anyway, so it may or may not make any difference from the database server's perspective. Speaking from experience with applications that have many, complex domain objects my own preference would be to use separate tables and one-to-one mappings. > From my point of view, selecting a little less > fields in the same table will rarely provide a big > performance gain. Especially if you then lazy load them > later. If there's a real gain, you should have put them in > another table anyway I think. Yes, two queries are much more likely to take longer than one. The application must be analyzed carefully to see which components are infrequently referenced in order to add the overhead. Again, in my experience most applications change enough over their lifetime that lazy loading may become inappropriate (or appropriate) as the application evolves. Given that, I'd say that choosing the one-to-one mapping is the best because configuring the lazy loading behavior is a simple configuration parameter. --- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=click ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 --- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Startup time
Happily, I'm currently having this problem on my project. It takes ages to load the configuration (more than one minute at least). So I played with OptimizeIt quickly. Our real problem was a little bit tricky (it's based on a special enum implementation we have, we have one custom type per enum type and each enum have a slow static block so each call to UserType.returnedClass is terrible) but I can take a general rule out of it. -> When hibernate is creating its configuration, it's using a huge bunch of classes. All persistent classes and classes related to them. So you spend most of the configuration setup doing two things: XML parsing and class loading. The thing is I'm not quite sure we can do something about this. One other thing that takes time is reflection. I don't know if some calls to ReflectHelper can be replaced by static code but it would help. Without caring about profiling I would have proposed two solutions: 1- Have hibernate being sloppier. I think it's doing a lot of validations when loading the configuration. Maybe we can have a mode where it doesn't do all that. 2- Lazy load the conf. I mean, don't load every file at the beginning, only when the session using the configuration needs it. So for instance load a persistent class only when there's a query on it. Again, a having the two possibilities will be nice (everything at startup or as needed). However, as Gavin said, it might not be possible... One cannot guess where is the class of query he is looking for. It might become possible it we change the approach. For instance having a addLazyClass(Class persistentClass) method so you know that it you need the mapping the the class, you know it's in the hbm.xml having the same name. I want to say that when deployed in an application server, the loading time it takes doesn't matter at all. It's for local testing, when the configuration is loaded often that it causes me problems.. Some guidelines for people having problems: - Don't put too much log on configuration loading, hibernate is pretty verbose in debug. (and for god sakes, don't put them in stdout...) - Try to put in the conf only the classes you really use for a test, not all the application ones. Dynamic hibernate configuration (.addClass() ) really helps for that. - Make sure you don't have any long static block in classes linked to your persistent classes so the class loader will load them quickly. - Load the configuration only once. For instance, do it for a complete test suite, not in each setUp. Once per app server. Hope it helps, Henri P.S.: Something that has nothing to do with what's above. If you have a query "from Player as player where player.team = :team", is it more efficient than "from Player as player where player.team.id = :team" or it doesn't make any difference? - Original Message - From: "Gavin King" <[EMAIL PROTECTED]> To: "Ara Abrahamian" <[EMAIL PROTECTED]> Cc: "'hibernate-devel'" <[EMAIL PROTECTED]> Sent: Tuesday, April 27, 2004 5:07 PM Subject: Re: [Hibernate] Startup time > Theres other problems with lazy compilation, its not doable. > > Ara Abrahamian wrote: > > >Most probably loading the hbm files and creating metadata objects is the > >bottleneck? And the solution is to lazy load them? > > > >Ara. > > > > > > > >>-Original Message- > >>From: [EMAIL PROTECTED] [mailto:hibernate-devel- > >>[EMAIL PROTECTED] On Behalf Of Gavin King > >>Sent: Tuesday, April 27, 2004 12:43 PM > >>To: hibernate-devel > >>Subject: [Hibernate] Startup time > >> > >>OK, I start to hear complaints about the startup time of Hibernate > >>almost everywhere I go now. It's an important issue, because it's a > >>problem that gets worse as people's applications get bigger, and it's > >>something that slows down developers. If there's /anything/ we are > >>about, it is about increasing the speed of development of large > >>applications. So this issue really cuts to the core of what we are > >>trying to achieve here. > >> > >>Max is trying to implement serialization of the SessionFactory, as one > >>possible solution, but perhaps there is some other way we could optimize > >>stuff. Does someone want to profile Hibernate startup, and discover > >>where the slow methods are? At least find out which work is dominating > >>at startup time? > >> > >> > >>-- > >>Gavin King > >>+61 410534454 > >> > >>Hibernate > >>[EMAIL PROTECTED] > >>http://hibernate.org > >> > >>JBoss Inc > >>[EMAIL PROTECTED] > >>http://jboss.com > >> > >> > >> > >>--- > >>This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > >>For a limited time only, get FREE Ground shipping on all orders of $35 > >>or more. Hurry up and shop folks, this offer expires April 30th! > >>http://www.thinkgeek.com/freeshipping/?cpg=12297 > >>___ > >>hibernate-devel mailing list > >>[EMAIL PROTECTED] > >>https://lists.sourceforge.net/lists/listinfo/hibernate-de
Re: [Hibernate] support for ON CASCADE DELETE
Does this remove the hibernate limitation on nullable foreign keys? (that foreign keys of collections need to be nullable even if there is a cascade all-delete-orphan). If yes, great! If no, still great! (but I'll be back on this issue). Henri - Original Message - From: "Gavin King" <[EMAIL PROTECTED]> To: "hibernate-devel" <[EMAIL PROTECTED]> Sent: Wednesday, July 21, 2004 6:32 AM Subject: [Hibernate] support for ON CASCADE DELETE > I've implemented support for ON DELETE CASCADE foreign key > definitions for parent/child associations (ie. for inverse > one-to-many). > > You map this like: > > > > > > > So, when the Parent instance is deleted, Hibernate > does not need to perform n+1 deletes; instead, we > leave that to the database to take care of. > > Any comments? > > -- > Gavin King > +61 41 053 4454 > +1 404 822 8349 > > Hibernate > [EMAIL PROTECTED] > http://hibernate.org > > JBoss Inc > [EMAIL PROTECTED] > http://jboss.com > > > > --- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] support for ON CASCADE DELETE
It's an issue a collegue of mine entered some times ago (HBI-31). But it wasn't well explained (and initially wasn't talking about hibernate 2 so don't even read it, it will makes things harder to explain). But anyway. I'm talking about the fact that hibernate is causing constraint violations if a foreign key is not null. (Very important note section 6.4 in the documentation) Sometime we need to remove a valid integrity constraint to prevent this. I understand that when you remove an object from a collection, since the object is not related to any parent anymore, that the foreign key should be set to null. But when you have a containment relation and so a all-delete-orphan cascade, it will never happen that objects will stay in the database having a null foreign key. But you still need to remove the constraint because hibernate consider the all-delete-orphan only at the end of the flushing process. So first all foreign keys are set to null and then all objects in the collection are deleted. This could be optimized by seeing there's an all-delete-orphan and so by deleting the contained objects directly. But now we have a delete cascade, so I just guessed that since all objects will be deleted by the DB in one shot, that I won't have my constraint problem anymore. Am I right? I don't know if I made myself clear. I can provide a test case if needed (and continue the discussion in the forum which is probably a more appropriate place I think). Sorry to have made you jump a little, Henri - Original Message - From: "Christian Bauer" <[EMAIL PROTECTED]> To: "Henri Tremblay" <[EMAIL PROTECTED]> Cc: "hibernate-devel" <[EMAIL PROTECTED]> Sent: Thursday, July 22, 2004 12:07 AM Subject: Re: [Hibernate] support for ON CASCADE DELETE > > On Jul 21, 2004, at 10:42 PM, Henri Tremblay wrote: > > > Does this remove the hibernate limitation on nullable foreign keys? > > (that > > foreign keys of collections need to be nullable even if there is a > > cascade > > all-delete-orphan). If yes, great! If no, still great! (but I'll be > > back on > > this issue). > > What? There is no Hibernate limitation like this. > > -- > Christian Bauer > +49 171 455 66 53 > > Hibernate > [EMAIL PROTECTED] > http://hibernate.org > > JBoss Inc > [EMAIL PROTECTED] > http://jboss.com > > --- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Why is the element required in the hibernate config (XML) file?
It is possible to do it in Hibernate2 but only using the hibernate.properties. It won't work with the xml. So you need to have the .properties for your configuration and then you can add your mapping programmatically. On Thu, 16 Dec 2004 08:27:50 +0100, Max Rydahl Andersen <[EMAIL PROTECTED]> wrote: > On Wed, 15 Dec 2004 20:49:51 -0800, Safdar Kureishy > <[EMAIL PROTECTED]> wrote: > > It is not that way in Hibernate3 anymore. > > I guess we could "backport" that to hibernate 2.1.8 if requested ;) > > Add a JIRA for 2.1.8 on changing mapping+ to mapping* in the DTD. > and see what happens ;) > > /max > > > Hi, > > > > > > I couldn't find any discussion on this topic so am posting this to the > > newsgroup ... > > > > > > I am running into a situation where I want to initialize a Hibernate > > Configuration object from a hibernate cfg file, but without any mappings > > (i.e without any elements). Instead, I want to add the > > mappings programmatically. However, during initialization of the > > Configuration object, I get a parser error since the DTD for the > > hibernate config file requires at least one element be > > specified under the element. > > > > > > So, a configuration like this: > > > > > > > > > > > > > > lkjsdlfkjsd > > > > ... > > > > ## > > THIS PORTION IS REQUIRED ### > > > > > > > > > > > > > > ... will give an error if the element is removed, based on the > > DTD. > > > > > > My question is, why is this required? It defeats the purpose of being > > able to specify different portions of the configuration separately ... > > > > > > Also, is there any way to not have to specify this element? I > > tried giving an empty element and one with > resource=""/> but both throw errors as well. > > > > > > Any ideas will be greatly appreciated. > > > > > > Thanks, > > > > Safdar > > > > > -- > Max Rydahl Andersen > callto://max.rydahl.andersen > > Hibernate > [EMAIL PROTECTED] > http://hibernate.org > > JBoss Inc > [EMAIL PROTECTED] > http://jboss.com > > --- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > ___ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ ___ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] Re: SV: Re: [PRODUCT] ORM + RDBMS = OODBMS / Evaluation Against Fictive jamStore
I still don't if it worth it by I've decided to answer this mail. Two parts, first: I've started using Hibernate on my project because of lots of performance issues doing straight JDBC and also loads of bugs. So we really needed an O/R mapping tool since there was way to many classes in our domain model (project is more than 10 thousands classes). At this time I tried OJB, JDO and Hibernate if I remember correctly. With Hibernate I was able to have a running example in 10 minutes (literally). It's the example bundled with the release. Then we started experiencing (I think 4 senior developers) to see if it was flexible enough to be used and if it has the required features. I think this took us 2 weeks to have a framework. Part of it are homemade tricks, part of it are tricks we found on the hibernate wiki. Reading the documentation needed to do a normal mapping takes about 1 hour. So... Seriously, I can't understand why you are complaining about not finding any quick start to use hibernate. Hibernate is probably the most documented and easy to use O/R mapping tool... Try Top Link just for fun you'll see what I mean. second: I've been subscribing to this list for almost two years now I think. Hibernate developers were always nice to me even when I was some kind of rude. They take lots of time everyday to answer questions asked on the forum, which forum works really well by the way (there's an efficient finder, you know what kind of person is answering you and you get notifications, that's all I need). And since I've subscribed, you are the first person ever to be kicked out and I'll say I was pretty happy to see it happened since the discussion wasn't really constructive. I'll tell you one thing. Disagreeing with you is not being rude. Not answering is rude. If you were developping hibernate you could offer support the way you want. They decided to use a forum, you can argue it's a bad choice, they will listen but at last, it's them to decide if they want to keep on with it. Not everybody on the internet should do what you say right away or otherwise being rude. Internet communication is based on discussion, not despotism or I missed the part where you were crowned "Great Emperor of the Internet". One last thing, I don't know what happened between you and JBoss but hibernate was there before they all started working for JBoss. And usually, starting to work for a company doesn't instantly make you evil as far as JBoss can be considered evil... Just for you to know, I'm an outsider here. I'm not working for JBoss and I don't know personnally any hibernate guys. I'm just using their product. Regards and merry Christmas to you all, Henri On Fri, 24 Dec 2004 03:52:03 +0200, Ilias Lazaridis <[EMAIL PROTECTED]> wrote: > Christian Bauer wrote: > > Ilias Lazaridis wrote: > > > >> sorry, cannot find a quick-start-guide. > >> > >> [btw: your message appears outside of the thread] > > > > OK, this is enough. Please don't feed the troll. > > Which statement exactly of the above two has caused you to write this > ungentle comment? > > You confirm my statement that you are rude. > > > This "Illiad" is > > picking any target and tries to start a flame war, not only here. A > > quick search on Google Groups shows several threads that end with "go > > away, we don't want you here". > > I'm evaluating hibernate. > > Can you please point me to the quick-start guide? > > I did not find it. > > > We never needed to ban someone from our developer list in three years, > > but I'll see what we can do. If we can't find a technical solution > > please don't reply to any of his emails or postings. This usually helps > > sooner or later. > > Correct. > > Ignoring is the method to take. > > > Back to business (or Christmas, if you are into that kind of thing). > > To Gavin King: > > Removing a person [which writes fully in topic] from a mailinglist is > censorship. > > http://www.mail-archive.com/hibernate-devel%40lists.sourceforge.net/msg04208.html > > - > > This here is not your personal playground. > > I ask you friendly to stop removing me from the list. > > . > > -- > http://lazaridis.com > > > --- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > ___ > hibernate-devel mailing list > hibernate-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ __
Re: [Hibernate] someone looking at flushing performance...
(Steve, sorry, you will get this mail twice... it seems that the gmail reply didn't do what I was expecting ie posting to the mailing list) --- Thanks Max for your comment on the forum, I was eagerly reading the thread in the mailing list and will now take time to add some water to the mill. Gavin, do you think it could be possible to downmerge in H2 you improvement on read-only objects since it seems something was done in H3? (worst case, if you give me some pointers I might be able to provide a patch for H2) About the second part, I understand it is not as easy to do as it easy to say. I will suggest to do an easy benchmark. Lets say you put around 10, 100 and 1000 objects in cache. You modified some ot them, sometime objects that are queried, sometime not. Then you perform a bunch of queries on them. You can do a quick hack just to handle basic mapping (nt cascade, collections or other tricky things) with the algorithm turned update down. Just to see if i worths the refactoring effort. But it's true that checking dirtiness on objects in the query table space and then complete then flush if needed is not that obvious. Maybe clearing the partial flush done on query table space and doing a flushEverything if it was determined that a flush is needed will still be faster and be easier. About the post-scriptum part on the forum. Using the code enrichment at compilation that H3 is doing can allow also to monitor dirtyness. That might also be a big performance improvement since no attributes compare will be needed anymore during the flush. Thanks for considering my comment, Henri P.S.: When doing benchmarks on hibernate, do you have a way to bypass the database so you can bench only hibernate performances? P.P.S: On thing I forgot. We are already doing http://blog.hibernate.org/cgi-bin/blosxom.cgi/2004/06/23#i18n. But by reference data I was meaning more complex objects (trading accounts, financial instruments, clients, stock exchanges). Things that might change lets say once a month. So we are willing to have them read-only most of the time and to refresh the level 2 caching manually when they are updated. On Tue, 4 Jan 2005 09:01:43 -0600, Steve Ebersole <[EMAIL PROTECTED]> wrote: > Right. Apparently I just used poorly chosen wording. What I meant to > say is that it is "conceptually" what TopLink achieves with its > separation of Session and UnitOfWork. As Gavin pointed out in his > response, sharing actual instances between sessions and/or threads is > not desirable. That was not my intent to imply such a thing. > > -Original Message- > From: Joshua Davis [mailto:[EMAIL PROTECTED] > Sent: Monday, January 03, 2005 10:18 PM > To: Steve Ebersole > Cc: Max Andersen; Hibernate development > Subject: Re: [Hibernate] someone looking at flushing performance... > > Steve Ebersole wrote: > > >[...snip...] Then we could continue to track these > >objects within the scope of object identity but not in the session > cache > >(aka, this is analogous to TopLink's distinction between Session and > >UnitOfWork). > > > > > ... except better than TopLink. The TOPLink Session stores objects > that are used by multiple threads, which introduces a lot of problems > that nobody needs to have. > > > > >-Original Message- > >From: [EMAIL PROTECTED] > >[mailto:[EMAIL PROTECTED] On Behalf Of Max > >Rydahl Andersen > >Sent: Sunday, December 26, 2004 1:53 PM > >To: Hibernate development > >Subject: [Hibernate] someone looking at flushing performance... > > > >...fyi: http://forum.hibernate.org/viewtopic.php?t=936291 > > > >Is he on to something or is the readonly stuff in H3 the answer to this > >? > > > > > > > > --- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almosthttp://www.thinkgeek.com/sfshirt > ___ > hibernate-devel mailing list > hibernate-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almosthttp://www.thinkgeek.com/sfshirt ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] byte[] to Blob and char[]/String to Clob
Hello, Recently I had a lot of "fun" playing with Blob on Oracle. The thing you need to be aware of is that the way to work with them depends on the driver you use. So the best way to insert a blob is different if you are using an oracle 9i thin, oracle 9i oci or some more JDBC compliant drivers like the one shipped by I-Net. You really need to consider this when testing Oracle. I might be able to found some code to perform the different insertions if you want. Maybe what I'm saying here is useless... I try to check your code but cvs doesn't want to allow me :-( Hope it helps, Henri On Apr 4, 2005 4:40 PM, Emmanuel Bernard <[EMAIL PROTECTED]> wrote: > Hi, > To support the EJB3 spec, I've implemented 5 new UserType > StringClobType > ChararcterArrayClobType > PrimaryChararcterArrayClobType > ByteArrayBlobType (will be commited tonight) > PrimaryByteArrayBlobType (will be commited tonight) > > I'm really not confident with that since Blob/Clob seems to be a real > mess esp with Oracle. > * Some of you can test them on various DB? > * some Blob/Clob experts can review my code. It has to stay quite portable. > > The code is in Annotations CVS, in src/org.hibernate.type. The test is > in test/org.hibernate.test.annotations.lob > > It does work for HSQLDB. > > Thanks > > -- > Emmanuel Bernard > [EMAIL PROTECTED] > callto://emmanuelbernard > > http://www.hibernate.org > > --- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > ___ > hibernate-devel mailing list > hibernate-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > --- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel