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

  • SEARCH
  • Home
  • 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 8144283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:20:10+00:00 2026-06-06T13:20:10+00:00

i have a simple question. if i use play.db.ebean.Model to have my Model extend

  • 0

i have a simple question. if i use play.db.ebean.Model to have my Model extend from Model, how can i save it into DB? more clearly: in Django, the database file is created and i save the object, it will be saved into db file and i dont do any sql statements for retrieving or saving objects.. how does this work in playframework?

lets say i have configured my database file in application.conf file like this:

db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:tcp://localhost/~/microblogdb"
db.default.user="sa"
db.default.password=""

now i have a database file somewhere in system.

now i have a Class User which extends Model as i stated above. now i want to save one User object into db. so i will do like this:

User user = new User();
user.username = "testusername";
user.fullname = "userfullname";
user.save();

what will happen after that save() call? can i now directly see my User object in database file?

appreciate any help!

many thanks

  • 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-06T13:20:11+00:00Added an answer on June 6, 2026 at 1:20 pm

    Yes it will, if you didn’t do any mistakes.

    Make sure that in application.conf you also UNcommented the line:

    ebean.default="models.*"
    

    Check sample applications in sample folder of the Play package you downloaded. For an example ComputerDatabase (not JPA version) to see the basics of working with Ebean.

    What’s more you can create constructor(s) in your model to simplify creating User model:

    public User(String username, String fullname) {
        this.username = username;
        this.fullname = fullname;
    }
    

    And use it in controller as:

    User user = new User("doniyor", "Doniyor The Great");
    user.save();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple question: if I use URLConnection.setUseCaches(true) when loading something from web,
Have a rather simple question. Does anyone knows if i can use jparallax both
I have a (hopefully) simple question. Is it possible to use SSHD tunneling to
New to Python, have a simple, situational question: Trying to use BeautifulSoup to parse
Question simple and quick: I have started to use Netbeans to write some code
I want to use Qt to create a simple GUI application that can play
I have simple question. User supplies URL to my PHP script where I fetch
I have simple type Question : public class Question { public string[] Tags {
i have a simple question: i have this var: $v = 24000,1500,1500,1500,1500,1500,; i would
i have a simple question, there is a function with parameter emp_id that opens

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.