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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:51:54+00:00 2026-06-13T07:51:54+00:00

I am developing an application that uses JPA 2.0 with MySQL 5 database. I

  • 0

I am developing an application that uses JPA 2.0 with MySQL 5 database.

I know that JPA hides the calls to the DB queries and makes it underthehood, and all i use is JPQL,

now does this makes the need for stored procedures less ? and how can i use stored procedures with JPA 2.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-06-13T07:51:55+00:00Added an answer on June 13, 2026 at 7:51 am

    Stored procedures have mostly gone out of favor (you can read some ideas on why here: http://www.codinghorror.com/blog/2004/10/who-needs-stored-procedures-anyways.html).

    In general unless you have performance issues or are working with legacy systems, it’s advised not to use stored procedures.
    Object Relational Mapping solutions, such as JPA, are now the industry standard, mostly because they let you write less, and are easier to maintain then other methods (such as using the DAO pattern and JDBC directly).

    For example consider adding a new column to a table you are using CRUD (Create,retrieve,update,delete) with:

    • Using a JPA you add the column to the table and add the property to the class with an annotation, that’s it.
    • With stored procedures, you’ll also need to add the parameter to the procedures to update or create a new entity, you’ll need to add the column to the insert or update statement inside the procedure, in some cases you’ll need to add the column to the select clause inside the procedure.

    In regards to using stored procedures, JPA doesn’t have support for stored procedures per se, but there are two way you can work around it:

    • Some JPA implementation (such as EclipseLink or Hibernate) support stored procedures, and you can use their implementation directly , you’ll have to see what implementation you are using.
    • You can use the “native query” feature, that let’s you write an sql in the Native database query language, for instance for mySQL you can write something like this:

      Query query = entityManager.createNativeQuery("{ CALL procedure(?) }");  
      query.setParameter(1, parameterName);
      

      You need to also remember that the procedure must return a result set and you can’t use out parameters.

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

Sidebar

Related Questions

I am developing a PHP application that uses SQLite as database management system, MySQL
I'm developing a spring application that uses large MySQL tables. When loading large tables,
I'm developing a Java EE Application that uses JPA to persist its data. At
I'm developing a java application that uses some jni calls. I have on C
I'm developing an web application that uses a non-relational database as a backend (django-nonrel
I'm developing from Mac OS X a java application that uses a SQLite database
I am developing a application that uses core data. In my application i would
I am developing an application that uses the SKPSMTPMessage to send the forgotten user
I'm developing an application that uses webservices in python, both sides (server and client)
I am developing an application that uses JS Tree with json data and ajax

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.