Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8052759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:38:05+00:00 2026-06-05T07:38:05+00:00

I want Username = Administrator and Password = admin , soon after table is

  • 0

I want Username = Administrator and Password = admin, soon after table is created (or whenever table is recreate).

  1. Is there any way to insert first row using following code. I do not want to use a separate insert query
  2. Is there any constraint in Hibernate to restrict user from deleting (first) row

    @Entity
    @Table(name = "Users")
    public class Users implements Serializable {
    
        @Id
        @Column(name = "Username", unique = true, nullable = false)
        private String username;
    
        @Column(name = "Password", nullable = false)
        private String password;
    
        /**************** getter & setter ************/
    
    }
    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:38:06+00:00Added an answer on June 5, 2026 at 7:38 am

    What you seem to be looking for is called fixtures. With Hibernate you can supply import.sql file on your classpath with your initial data (insert statements).

    There’s a bit more information on the JBoss’ site.

    The import.sql file is a simple text file with SQL statements, one line per statement:

    insert into users (id, username) values (1, 'administrator');
    insert into users (id, username) values (2, 'user');
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to allow users to either have there username field empty at any
I want to authenticate the administrator username's password. The administrator username is not a
I want the username to be any characters with _ or - in it
I want save the username and password when user login, and I added the
I have three tables: Users, Groups and GroupsUsers User table: id: 1 username: admin
I have this object graph, I want to map: abstract Account (username, password, ...)
i have a signup page and i want to check username exists or not
I am new to ASP.NET MVC 3 and I want to have username/id as
i want to replace the username in the class of current selector with the
I want to display the username/last connection date/time and some other info on all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.