Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » [RESOLVED] How to Query "nextval('sequence_name');" in EclipseLink(how to, better way to)
[RESOLVED] How to Query "nextval('sequence_name');" in EclipseLink [message #1021259] Tue, 19 March 2013 14:51 Go to next message
Eclipse UserFriend
Hello all,

Well I'm new here and newbie with EclipseLink ,byt I would like to know, how to make get value from this query:

"SELECT nextval('sequence_name');"


I need to use the sequence generated by database on the webapp. This value will not be used on the database to persist anything, it's just a way to generate am unique value to a method execution/process...

It's possible to make something like this?
I read a litle about the EclipseLink and see some Screencasts but I couldn't understand how to make this query works.

Thanks all.

[Updated on: Wed, 20 March 2013 08:58] by Moderator

Re: How to Query "nextval('sequence_name');" in EclipseLink [message #1021641 is a reply to message #1021259] Wed, 20 March 2013 08:58 Go to previous messageGo to next message
Eclipse UserFriend
Well I make this works in The J2SE, but not in j2EE.
Re: How to Query "nextval('sequence_name');" in EclipseLink [message #1027042 is a reply to message #1021641] Tue, 26 March 2013 09:56 Go to previous message
Eclipse UserFriend
You can use a native SQL query.

em.createNativeQuery("SELECT MYSEQUENCE.NEXTVAL FROM DUAL").getSingleResult();
Previous Topic:how to store a page of text as string in JPA 2.0
Next Topic:Infinite loop with self-referencing bi-directional relationship
Goto Forum:
  


Current Time: Wed Jul 23 19:27:07 EDT 2025

Powered by FUDForum. Page generated in 0.03786 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top