Yes, I did something similar recently. On Tue, 2005-05-03 at 15:38 +0200, Darius Schier [orthagis] wrote: > If you use hibernate, I would suggest using an abstract base class that > contains your audit fields and givin it > @andromda.hibernate.inheritance=interface (don't forget to give it the > <<Entity>> stereotype. Then just do a generalisation for each of your 'real' > tables according to that class. > Everything would be generated perfectly, the fields from the abstract base > class will be inherited and generated into all hbm files, sql statements, > ..., but the clue is that no base table will be generated (which is exactly > what you want for those technical attributes). > > Would take about two minutes to put it into the model and another two for > generation which beats Wouter's proposal by far :o) > > Regards > Darius > > -----UrsprÃngliche Nachricht----- > Von: Wouter Zoons [mailto:[EMAIL PROTECTED] > Gesendet: Dienstag, 3. Mai 2005 13:52 > An: [email protected] > Betreff: Re: [Andromda-user] DB Audit Fields > > > > > Hello. > > > > Where I work, we have standard audit fields in our > > database tables such as created_by (varchar), > > updated_by (varchar), created_on (date), updated_on > > (date). > > > > I would like to make an Andromda model of our database > > but I don't want to define these four fields for over > > 50 tables. > > > > Can someone recommend an easy way to accomplish this? > > > > > you could customize the templates, should be straightforward > that way any new entities will also have those fields > > assuming you're using hibernate as persistence framework you would simply > update the mapping files and the Entity.java templates > > on the other hand, I don't know what tool you're using for modeling, but > in MagicDraw you can simply 'copy' the attributes and 'paste' them into > another entity, it will copy everything: name, type, documentation, ... > > 10 seconds per entity (which is plenty) = 500 seconds per 50 entities = 6 > minutes, not that bad > > > -- Wouter > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great events, 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r > _______________________________________________ > Andromda-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/andromda-user > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great events, 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r > _______________________________________________ > Andromda-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/andromda-user -- regards Martin West 01962 712 137 07879 680 096 http://thecla.homeftp.net aim:amartinwest msn:[EMAIL PROTECTED]
------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. Get your fingers limbered up and give it your best shot. 4 great events, 4 opportunities to win big! Highest score wins.NEC IT Guy Games. Play to win an NEC 61 plasma display. Visit http://www.necitguy.com/?r _______________________________________________ Andromda-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/andromda-user
