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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:32:57+00:00 2026-05-15T16:32:57+00:00

I am importing stock quotes data using HibernateTemplate + SpringFramework Format of the data

  • 0

I am importing stock quotes data using HibernateTemplate + SpringFramework

Format of the data

AAPL,09-Jun-2010 09:00,251.47,251.47,251.39,251.39,640
AAPL,09-Jun-2010 09:01,251.4,251.4,251.05,251.26,6844
INTC,09-Jun-2010 09:00,251.47,251.47,251.39,251.39,640
INTC,09-Jun-2010 09:01,251.4,251.4,251.05,251.26,6844
MSFT,09-Jun-2010 09:00,251.47,251.47,251.39,251.39,640
MSFT,09-Jun-2010 09:01,251.4,251.4,251.05,251.26,6844

I have one Entity class called Stock

@Entity
public class Stock implements Serializable {
public Stock() {}

private Long id;
private BigDecimal open;
    .... close,high, low..etc
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
public Long getId() {
    ....

My problem with this setup is that hibernate will put everything into a table called “Stock”.

I want to separate different stock into a different table, so with the data above I will end up having 3 tables (AAPL, MSFT, INTC)

Is there an easy way to do this without resorting to hand-written sql statement in Hibernate/HibernateTemplate? sort of creating the table dynamically?

Environment:
– Mysql, Hibernate3.5.3, springframework3.0

  • 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-15T16:32:58+00:00Added an answer on May 15, 2026 at 4:32 pm

    I want to separate different stock into a different table, so with the data above I will end up having 3 tables (AAPL, MSFT, INTC)

    Then either introduce an inheritance hierarchy (with a JOINED or TABLE_PER_CLASS strategy) and persist the appropriate sub type or maybe use horizontal partitioning (this would require some testing though, I’ve never done that with MySQL and Hibernate).

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

Sidebar

Related Questions

I am importing a csv of stock data into R, with column names of
After importing content from a legacy website using the Feeds module, I'm left with
When importing or exporting Databases using Taps in heroku , is it necessary that
I am importing data from MySQL to PowerPivot. I have all of the relevant
What is difference Difference Between Import All Products/import Product Stock when your importing a
I am importing some data from NOAA and it has dates and times in
I've been working on importing XML into an iPad Core Data application. I have
I'm importing some arbitrary HTML into a DOMDocument using the loadHTML() function, eg.: $html
I'm stuck with a bit of a problem here. I'm importing data from a
I am importing some c++ dll into a c# project, I am using visual

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.