Re: Using sql files instead of the DB itself
Erik Wright <[email protected]>
| Newsgroups | gmane.comp.java.ejb.middlegen.user |
|---|---|
| Organization | Zero Knowledge Systems, Inc. |
| Message-ID | <[email protected]> |
Sorry David. Perhaps a Hibernate expert will have some answers for you but I'm not familiar with the tool. -Erik On Tue, 2004-08-10 at 15:51, [email protected] wrote: > Hi Erik, > > We're not using EJBs, just a web app accessing our business logic. Do you > know if equals() needs to be defined in this case? > > I believe now that you can specify in each .hbm.xml the sequence name for > each table, just trying to figure it out how to set it via Ant! I guess I > could modify Middlegen too, but then it would be db specific. > > cheers, > > David > > > > |---------+------------------------------------------> > | | Erik Wright | > | | <[email protected]> | > | | Sent by: | > | | [email protected]| > | | ceforge.net | > | | | > | | | > | | 08/10/2004 01:46 PM | > | | Please respond to | > | | middlegen-user | > | | | > |---------+------------------------------------------> > >------------------------------------------------------------------------------------------------------------------------| > | | > | To: [email protected] | > | cc: | > | Subject: Re: [Middlegen-user] Using sql files instead of the DB itself | > >------------------------------------------------------------------------------------------------------------------------| > > > > > Assuming you're using EJBs, as we are, you don't want to use equals() - > use isIdenticalTo() instead. If you want custom comparison behaviour you > will need to implement some sort of business method yourself by writing > a merge file. > > For sequences, we did experiment with the built-in sequence behaviour, > but to the best of my recollection all that was possible was to specify > one sequence that would be shared amongst all tables. > > In the end, we modified Middlegen to have some very specific behaviour > with regards to sequences and pk generation. If you want to customize > the behaviour, you'll want to look at the entity bean template which is > in the Middlegen source tree at: > > plugins/entitybean/src/middlegen/plugins/entitybean/entity-cmp-20.vm > > Ours looks up a Stateless Session Bean, passes the name of the table, > and receives back a PK. The implementation of the bean is specific to > our project. > > -Erik > > On Tue, 2004-08-10 at 13:24, [email protected] wrote: > > Hi Erik, > > > > Do you do anything in your build process to set up the equals() method, > or > > sequence names? Am having difficulty automating this... > > > > cheers, > > > > David > > > > > > > > |---------+------------------------------------------> > > | | Erik Wright | > > | | <[email protected]> | > > | | Sent by: | > > | | [email protected]| > > | | ceforge.net | > > | | | > > | | | > > | | 08/10/2004 09:28 AM | > > | | Please respond to | > > | | middlegen-user | > > | | | > > |---------+------------------------------------------> > > > >------------------------------------------------------------------------------------------------------------------------| > > > | > | > > | To: [email protected] > | > > | cc: > | > > | Subject: Re: [Middlegen-user] Using sql files instead of the > DB itself | > > > >------------------------------------------------------------------------------------------------------------------------| > > > > > > > > > > > You could always load the SQL into a temporary schema/database, or a > > Cloudscape/HSQLDB in-memory DB or something, and then point Middlegen at > > that. > > > > Our build process connects to Oracle, creates a user for the developer > > performing the build (suffixes the user name with '_${env.USER}'), which > > automatically creates a schema for them, then connects as that user and > > inserts our schema via a SQL script. All that's left at that point is to > > run Middlegen. > > > > But if you don't have that kind of flexibility with your actual DB > > platform, I suppose you could run a DB locally, either a Java one (which > > might be easier to configure as part of an integrated build) or MySQL, > > PostgreSQL, etc. > > > > -Erik > > > > On Tue, 2004-08-10 at 01:36, Jonathan Scott wrote: > > > Hi All, > > > > > > I am wondering if it is at all possible to read tables from a SQL file > > instead of from the DB itself. The point being that the SQL files will > tell > > us the current structure of the DB better than a possibly out of date > > schema, built only who knows when. > > > > > > If there is such a way to get the schema from files instead of the DB, > > please advise on how to do it, or where to look on how to do it. > > > > > > Much appreciated, > > > Jonathan Scott > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > > _______________________________________________ > > middlegen-user mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/middlegen-user > > > > > > > > > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > > _______________________________________________ > > middlegen-user mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/middlegen-user > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > middlegen-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/middlegen-user > > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > middlegen-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/middlegen-user ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285