Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL : Stored procedure support #15

Closed
timowest opened this issue Oct 3, 2011 · 8 comments
Closed

SQL : Stored procedure support #15

timowest opened this issue Oct 3, 2011 · 8 comments

Comments

@timowest
Copy link
Member

timowest commented Oct 3, 2011

Stored procedure support

Pseudocode

CREATE OR REPLACE PROCEDURE order_update (id INTEGER, customer_id INTEGER, amount OUT DECIMAL);

OrderUpdate orderUpdate = new OrderUpdate(configuration, connection);
// OrderUpdate is generated based on a stored procedure with the same name
orderUpdate.setId(123);
orderUpdate.setCustomerId(7849320);
orderUpdate.execute();
Double amount = orderUpdate.getAmount();
@timowest
Copy link
Member Author

Closing this for now, since I couldn't find a way to provide typesafe stored procedure support in Querydsl. Feel free to reopen this.

@samyem
Copy link

samyem commented Jan 25, 2013

The PreparedStatement.getParameterMetaData() on the SP can be queried in JDBC to generate the types isn't it?

@timowest
Copy link
Member Author

But is this available via database metadata?

@samyem
Copy link

samyem commented Jan 25, 2013

Should this not work the same way as tables for the parameter and proc name?
http://www.java2s.com/Code/Java/Database-SQL-JDBC/GetStoredProcedureSignature.htm

For the returned resultset of the prodedure, we can pass in a bean class as
an argument as part of the execute method. The rest all comes from the db
metadata, isn't it?

On Fri, Jan 25, 2013 at 2:13 PM, Timo Westkämper
notifications@github.comwrote:

But is this available via database metadata?

@timowest timowest reopened this Jan 25, 2013
@samyem
Copy link

samyem commented Jan 25, 2013

One of the tricky situations may be to properly handle things like the in-out parameters and get them registered in the call, but all this info comes in the metadata so the generated code should be able to handle it easily.

@davidkarlsen
Copy link

Would be very nice to see this features - and it's a feature JOOQ has: http://www.jooq.org/doc/3.2/manual/sql-execution/stored-procedures/

@fasfsfgs
Copy link

fasfsfgs commented Apr 7, 2016

I just used stored procedure support for JPA 2.1 and it did a good work.

https://docs.oracle.com/javaee/7/api/javax/persistence/NamedStoredProcedureQuery.html
https://javaee-spec.java.net/nonav/javadocs/javax/persistence/StoredProcedureQuery.html

jwgmeligmeyling pushed a commit that referenced this issue Dec 28, 2020
Add CodeWriter.getClassConstant() to abstract the difference between A.class in Java and classOf[A] in Scala.
@stale
Copy link

stale bot commented Jun 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 3, 2021
@stale stale bot closed this as completed Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants