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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:32:47+00:00 2026-06-18T07:32:47+00:00

I just used Hibernate reverse engineering to reverse engineer my project and I see

  • 0

I just used Hibernate reverse engineering to reverse engineer my project and I see that it created a number of POJO java classes and alot of *.hbm.xml files.

in the past my java code looked like this:

@Entity
@Table(name = "enrollment")
public class Enrollment {

    @Id
    @Column(name = "enrollment_id")
    private Integer enrollment_id;

    @Column(name = "file_num")
    private String file_num;

    @Column(name = "eis_num")
    private String eis_num;

    @Column(name = "enrollment_type_id")
    private String enrollment_type_id;

    @Column(name = "ssn")
    private String ssn; 

    @Column(name = "first_name")
    private String first_name;

    @Column(name = "last_name")
    private String last_name;

    @Column(name = "middle_initial")
    private String middle_initial;

    @Column(name = "contact_id")
    private Integer contact_id;

    @Column(name = "retired_date")
    private String retired_date;

    @Column(name = "deferred_date")
    private String deferred_date;

    @Column(name = "school_id")
    private String school_id;

    @Column(name = "borough_id")
    private String borough_id;

    @Column(name = "profile_id")
    private String profile_id;

    @Column(name = "current_status")
    private String current_status;

    @Column(name = "last_update")
    private String last_update;

    @Column(name = "entry_date")
    private String entry_date;

    public void setProfile_id(String profile_id) {
        this.profile_id = profile_id;
    }   

    public Integer getEnrollment_id() {
        return enrollment_id;
    }

    public void setEnrollment_id(Integer enrollment_id) {
        this.enrollment_id = enrollment_id;
    }

    public String getFile_num() {
        return file_num;
    }

    public void setFile_num(String file_num) {
        this.file_num = file_num;
    }

    public String getEis_num() {
        return eis_num;
    }

    public void setEis_num(String eis_num) {
        this.eis_num = eis_num;
    }

    public String getEnrollment_type_id() {
        return enrollment_type_id;
    }

    public void setEnrollment_type_id(String enrollment_type_id) {
        this.enrollment_type_id = enrollment_type_id;
    }

    public String getSsn() {
        return ssn;
    }

    public void setSsn(String ssn) {
        this.ssn = ssn;
    }

    public String getFirst_name() {
        return first_name;
    }

    public void setFirst_name(String first_name) {
        this.first_name = first_name;
    }

    public String getLast_name() {
        return last_name;
    }

    public void setLast_name(String last_name) {
        this.last_name = last_name;
    }

    public String getMiddle_initial() {
        return middle_initial;
    }

    public void setMiddle_initial(String middle_initial) {
        this.middle_initial = middle_initial;
    }

    public Integer getContact_id() {
        return contact_id;
    }

    public void setContact_id(Integer contact_id) {
        this.contact_id = contact_id;
    }

    public String getRetired_date() {
        return retired_date;
    }

    public void setRetired_date(String retired_date) {
        this.retired_date = retired_date;
    }

    public String getDeferred_date() {
        return deferred_date;
    }

    public void setDeferred_date(String deferred_date) {
        this.deferred_date = deferred_date;
    }

    public String getSchool_id() {
        return school_id;
    }

    public void setSchool_id(String school_id) {
        this.school_id = school_id;
    }

    public String getBorough_id() {
        return borough_id;
    }

    public void setBorough_id(String borough_id) {
        this.borough_id = borough_id;
    }



    public String getCurrent_status() {
        return current_status;
    }

    public void setCurrent_status(String current_status) {
        this.current_status = current_status;
    }

    public String getLast_update() {
        return last_update;
    }

    public void setLast_update(String last_update) {
        this.last_update = last_update;
    }

    public String getEntry_date() {
        return entry_date;
    }

    @Override
    public String toString() {
        return "Enrollment [enrollment_id=" + enrollment_id + ", file_num="
                + file_num + ", eis_num=" + eis_num + ", enrollment_type_id="
                + enrollment_type_id + ", ssn=" + ssn + ", first_name="
                + first_name + ", last_name=" + last_name + ", middle_initial="
                + middle_initial + ", contact_id=" + contact_id
                + ", retired_date=" + retired_date + ", deferred_date="
                + deferred_date + ", school_id=" + school_id + ", borough_id="
                + borough_id + ", profile_id=" + profile_id
                + ", current_status=" + current_status + ", last_update="
                + last_update + ", entry_date=" + entry_date
                + ", getEnrollment_id()=" + getEnrollment_id()
                + ", getFile_num()=" + getFile_num() + ", getEis_num()="
                + getEis_num() + ", getEnrollment_type_id()="
                + getEnrollment_type_id() + ", getSsn()=" + getSsn()
                + ", getFirst_name()=" + getFirst_name() + ", getLast_name()="
                + getLast_name() + ", getMiddle_initial()="
                + getMiddle_initial() + ", getContact_id()=" + getContact_id()
                + ", getRetired_date()=" + getRetired_date()
                + ", getDeferred_date()=" + getDeferred_date()
                + ", getSchool_id()=" + getSchool_id() + ", getBorough_id()="
                + getBorough_id() + ", getCurrent_status()="
                + getCurrent_status() + ", getLast_update()="
                + getLast_update() + ", getEntry_date()=" + getEntry_date()
                + ", getClass()=" + getClass() + ", hashCode()=" + hashCode()
                + ", toString()=" + super.toString() + "]";
    }

    public void setEntry_date(String entry_date) {
        this.entry_date = entry_date;
    }


}

but the code that the Hibernate reverse engineering create dont have any of the @Entity, @Table or @Column tags it looks like all the mappings are in the hbm.xml. How do I use them in a Spring MVC project

  • 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-18T07:32:48+00:00Added an answer on June 18, 2026 at 7:32 am

    You could use the hbm.xml files, include it in the applicationContext and use it in the project. The only difference is that all the mappings will be present in the hbm file. Where as you had them as annotations in your code.

    Your application Context should look like this:

        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="dataSource" ref="myDataSource" />
            <property name="mappingResources">
                <list>
                              <!-- All your hbms --><value>yourHbmFile.hbm.xml</value>
    
                </list>
            </property>
    ..
    .
    </bean>
    

    Also if you want to map a directory which contains all the hbm’s you can use:

    <property name="mappingDirectoryLocations" value="classpath:org/../hibernate/model" /> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I was working with java spring hibernate struts2 eclipse project. I used buildpath->
I am not much familiar with Java Quartz, we just used a test job
Reverse engineering an existing database to map with N-Hibernate using Fluent N-Hibernate. How can
I'm just starting to learn Java database persistence using Hibernate ORM and have run
I have a much used project that I am working on currently updating. There
I have lots of Java enums that I persist with Hibernate. As far as
I'm used to work with Criteria API in Hibernate, and just watched how the
The project used Spring + Hibernate Sample code: public void method(){ try{ dao.saveA(entityA); //condition
Our web project uses spring3, Jpa (hibernate). To save CRUD and other commonly used
I've just setup my first Spring MVC 3 project with Hibernate 3 using Maven.

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.