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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:18:02+00:00 2026-05-13T11:18:02+00:00

I was doing simple things with hibernate, as I have to learn it for

  • 0

I was doing simple things with hibernate, as I have to learn it for a project. I created this simple example:

package hibtests;

import hibtests.beans.newBean;
import org.hibernate.Session;

/**
 *
 * @author dario
 */
public class Main {


    public void test(){
        Session session = NewHibernateUtil.getSessionFactory().getCurrentSession();

        session.beginTransaction();

        newBean nb = new newBean();
        nb.setNome("FooFoo");
        session.save(nb);

        session.getTransaction().commit();

    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here

        Main main = new Main();
        main.test();
    }

}

…and it was working fine, putting rows in the db. Then I worked on another class for a couple of hours. I try this example again and Hibernate makes this strange query:

Hibernate: 
    insert 
    into
        TEST
        (ID, NOME) 
    values
        (default, ?)
Hibernate: 

values
    identity_val_local()

like it just can’t read the property that is FooFoo. I checked if I changed the source… but it is not the case. Everything is just like before and there are not exceptions. The newBean instance is not null and FooFoo is in the Nome field. Why this?

Oh, I forgot, I’m using Netbeans 6.8 and JavaDB.

As requested, my mapping follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="hibtests.beans.newBean" table="APP.TEST">
        <id name="id" column="ID">
           <generator class="identity"/>
        </id>
        <property name="nome" column="NOME" type="string"/>
    </class>
</hibernate-mapping>

Last minute update: turns out that insertion is working. Anyway I can still see the query with a ? instead of the string. Why?


As requested newbean source code follows:

public class newBean {

Long id;

public Long getId() {
    return id;
}

public void setId(Long id) {
    this.id = id;
}

public String getNome() {
    return nome;
}

public void setNome(String nome) {
    this.nome = nome;
}
String nome;

}

  • 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-13T11:18:03+00:00Added an answer on May 13, 2026 at 11:18 am

    You will never see the value of the strings being inserted in the DB, you will always see them as question marks (?) there are sniffers that will show their contents, but in standard hibernate you will not see any values.

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

Sidebar

Ask A Question

Stats

  • Questions 276k
  • Answers 276k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yui treeview should be collapsed by default If you are… May 13, 2026 at 2:49 pm
  • Editorial Team
    Editorial Team added an answer Try the following: <div contenteditable="true">Hello, edit me!</div> Not tested in… May 13, 2026 at 2:49 pm
  • Editorial Team
    Editorial Team added an answer As far as I know, TFileSaveDialog will raise an exception… May 13, 2026 at 2:49 pm

Related Questions

When do Enumerations break down? To support a new feature in an existing system,
While the C# spec does include a pre-processor and basic directives (#define, #if, etc),
I've been doing some WPF development for the last few months, and I've recently
I have some VB code which makes use of a COM api and results
Usually, the best practice in python, when using international languages, is to use unicode

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.