-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Initial inserts
PostPosted: Mon Dec 29, 2003 10:55 am 
Regular
Regular

Joined: Thu Dec 25, 2003 12:33 am
Posts: 58
Location: Campina Grande, Brasil
Is it possible to have an initial insert statement generated in my ".sql" output file, which is generated by SchemaExport?
For instance, i have a User t able. All authentications come from a query to this table. I'd like to have a default login and password for the admin. I can do it by writing the insert statement at the end of the generated .sql file. Ok, but is there a way to make it automatic ? Is there a way to make hibernate generate some insert statements in the .sql file?

Thansk a lot

_________________
Ot


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 29, 2003 12:02 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hibernate tools is the proper forum.
How about using Hibernate and session.save(InitialLogin) ? For .sql files, this isn't possible AFAIK

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2003 12:08 am 
Regular
Regular

Joined: Thu Dec 25, 2003 12:33 am
Posts: 58
Location: Campina Grande, Brasil
Ok, but let's imagine i need this initial default admin account since the very first use of my app. The first page any user is going to see is the logon page. So, do you sugest me implementing an Action class wich is gonna be used just for initial settings ? How to make sure this Action is going to be used only one time, and only at the first time?

Thaks for your reply

_________________
Ot


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2003 6:40 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
If it's only for one line, just write it by hand at the end of your schema export file.. This is classical installation requirements of an application: one shot stuffs
If you're too lazy, write the hibernate code and use p6spy to copy/pastle the sql statements ;-)

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.