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 7543915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:33:09+00:00 2026-05-30T08:33:09+00:00

I created simple DB with LibreOffice Base and exported it with SCRIPT command. It

  • 0

I created simple DB with LibreOffice Base and exported it with SCRIPT command. It has only one table Tag with “id” and name. I created corresponding class named Tag, with annotation @Entity, and for id @Id.

I load data with following code:

public static void main(String[] args){     

    Configuration configuration=new Configuration();
    configuration.configure();
    serviceRegistry=new ServiceRegistryBuilder().applySettings(
    configuration.getProperties()).buildServiceRegistry();
    sessionFactory=configuration.buildSessionFactory(serviceRegistry);
    session=sessionFactory.openSession();
    session.beginTransaction();

    tag=(Tag) session.get(Tag.class, 1);
    session.close();
    System.out.println(tag.getName());
}

Running this i get follwing lines:

Hibernate: select tag0_.id as id0_0_, tag0_.name as name0_0_ from Tag tag0_ where tag0_.id=?

and NullPointerException.

in xml file i have specified the file to be used “jdbc:hsqldb:file:testdb”, also added Tag as a mapping class.. What i am doing wrong??

  • 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-05-30T08:33:11+00:00Added an answer on May 30, 2026 at 8:33 am

    If you use Hibernate+HSQLDB for testing you could set property “hibernate.hbm2ddl.auto” to
    “create” – in that case hibernate will create required schema by itself

    hibernate.hbm2ddl.auto Automatically validates or exports schema DDL
    to the database when the SessionFactory is created. With create-drop,
    the database schema will be dropped when the SessionFactory is closed
    explicitly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created simple Java class to test file writes from applets: update appeared
I created a simple model and then mapped it to a class using sqlalchemy
I've created simple trigger to create cloud table (MyISAM table just to perfor FULL
I've created simple string class with some extra functions - its mainly for learning
I have created simple project with class Main and public static void main and
I have created simple script: #!/bin/sh column=${1:-1} awk '{colawk='$column'+1; print colawk}' But when I
Could someone help me on this, i have created simple webservices and it has
Could someone help me on this, I have created simple web services using axis2
How to manually create Friendly URLs? (PHP) So I have created simple php file
I created a simple .NET windows application in Visual Studio 2005 and on just

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.