Java/JPA experts need ur help.. Chalanachithram.com | Topics | Search
Hide Clipart | Log Out | Register | Edit Profile

Last 30 mins | 1 | 2 | 4 hours     Last 1 | 7 Days

Chalanachithram.com DB » New TF Industry Related » Archive through September 15, 2013 » Java/JPA experts need ur help.. « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 21379
Registered: 01-2011
Posted From: 68.13.100.193

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, September 14, 2013 - 12:47 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Dreamcatcher:



What do you mean how do you do that? That is how you do it, when you do an aggregate function in select, it returns a BigDecimal back to you in the result set. What error are you getting? Post the error and stack trace if you can.




replace that big decimal with oracle ref cursor. if it is char/int/single value..its easy n staight forward

I got some error...oracleresultsetimpl cannot type cast to lis/hash/class/ etc errors...
Top of pagePrevious messageNext messageBottom of page Link to this message

Dreamcatcher
Side Hero
Username: Dreamcatcher

Post Number: 4555
Registered: 11-2009
Posted From: 96.231.199.120

Rating: N/A
Votes: 0 (Vote!)

Posted on Saturday, September 14, 2013 - 12:44 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:

how do you do that? I tried with getResult, getSingleResult but have issues with reading the data.




What do you mean how do you do that? That is how you do it, when you do an aggregate function in select, it returns a BigDecimal back to you in the result set. What error are you getting? Post the error and stack trace if you can.
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 21355
Registered: 01-2011
Posted From: 68.13.100.193

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 09:59 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Rudraksha:

JPA emi tool? billing enta untadi?


freeeeeeee freeeeeee
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 21354
Registered: 01-2011
Posted From: 68.13.100.193

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 09:59 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Dreamcatcher:




Go to the end. You have

String sup_name ="Tortuga Trading";
BigDecimal sum = (BigDecimal)em.createNativeQuery("SELECT sum_total(?1) FROM DUAL")
.setParameter(1, sup_name)
.getSingleResult();
out.println("The total cost of the ordered products supplied by Tortuga Trading: " + sum +"<br/>");
Assume that this stored function (not procedure) returns a cursor which has all columns from orderlineitems table

how do you do that? I tried with getResult, getSingleResult but have issues with reading the data.
Top of pagePrevious messageNext messageBottom of page Link to this message

Dreamcatcher
Side Hero
Username: Dreamcatcher

Post Number: 4554
Registered: 11-2009
Posted From: 96.231.199.120

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 09:46 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

Post few lines of your code...I want to see wha method you are calling on Query.
Top of pagePrevious messageNext messageBottom of page Link to this message

Dreamcatcher
Side Hero
Username: Dreamcatcher

Post Number: 4553
Registered: 11-2009
Posted From: 96.231.199.120

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 09:45 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

Does tis help?

http://www.oracle.com/technetwork/articles/vasiliev-jpql-087 123.html
Top of pagePrevious messageNext messageBottom of page Link to this message

Cyberabadsinnodu
Side Hero
Username: Cyberabadsinnodu

Post Number: 8505
Registered: 02-2010
Posted From: 67.163.149.59

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 09:05 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Rudraksha:


its actually standard or implementation....daniki evadiki tochinattu vadu frameworks raaskunnar...openjpa etc
ROM lo undi DB ni prawxy lo chuse mahanubavulu kosam ee signature
Top of pagePrevious messageNext messageBottom of page Link to this message

Cyberabadsinnodu
Side Hero
Username: Cyberabadsinnodu

Post Number: 8504
Registered: 02-2010
Posted From: 67.163.149.59

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 09:04 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Rudraksha:

JPA emi tool?


adhi framework kada annai...!! billing emi seperate ga undadhu java job lo jpa ni oka req ga adugutaru
ROM lo undi DB ni prawxy lo chuse mahanubavulu kosam ee signature
Top of pagePrevious messageNext messageBottom of page Link to this message

Rudraksha
Comedian
Username: Rudraksha

Post Number: 1417
Registered: 07-2012
Posted From: 70.181.57.58

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 08:05 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

JPA emi tool? billing enta untadi?
Top of pagePrevious messageNext messageBottom of page Link to this message

Cyberabadsinnodu
Side Hero
Username: Cyberabadsinnodu

Post Number: 8502
Registered: 02-2010
Posted From: 67.163.149.59

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 07:58 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:

it wont work.


annai nee file ampinchu if it is ok with u....if u want change package names etc.
ROM lo undi DB ni prawxy lo chuse mahanubavulu kosam ee signature
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 21352
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 06:25 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Twitter:



asalu edoka type lo kaakunda genl object lo petti choodu


adi kooda ayyidni..it wont work.
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 21351
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 06:24 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Cyberabadsinnodu:



TypedQuery<abc> query =
em.createQuery("SELECT c FROM xxx c", xxx.class);
List<abc> results = query.getResultList();



This doesnt return a cursor.
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 21350
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 06:10 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Biriyani:



before typecasting...find out the type of object by using getclass method...




I am not sure...if it works...since it is JPA way of doing..little complicated
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 21349
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 06:09 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Triggerblaster:


Need not be mama..nativequery tho resultsets kooda ravochu...we were expecting single set in SP call...it didnt work..
Top of pagePrevious messageNext messageBottom of page Link to this message

Abhysg
Hero
Username: Abhysg

Post Number: 11089
Registered: 08-2008
Posted From: 68.46.32.32

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 05:05 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

friday 4pm ki ee kochen adugutava... enti ee durmargam..
no siggy
Top of pagePrevious messageNext messageBottom of page Link to this message

Twitter
Megastar
Username: Twitter

Post Number: 29660
Registered: 10-2009
Posted From: 69.118.124.210

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 04:58 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:

we were gettng the same typecast error..




asalu edoka type lo kaakunda genl object lo petti choodu
Top of pagePrevious messageNext messageBottom of page Link to this message

Cyberabadsinnodu
Side Hero
Username: Cyberabadsinnodu

Post Number: 8501
Registered: 02-2010
Posted From: 67.163.149.59

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 04:42 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:


instead of query try typedquery

TypedQuery<abc> query =
em.createQuery("SELECT c FROM xxx c", xxx.class);
List<abc> results = query.getResultList();
ROM lo undi DB ni prawxy lo chuse mahanubavulu kosam ee signature
Top of pagePrevious messageNext messageBottom of page Link to this message

Biriyani
Side Hero
Username: Biriyani

Post Number: 9609
Registered: 03-2012
Posted From: 171.161.160.10

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 04:36 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:

we were gettng the same typecast error..




before typecasting...find out the type of object by using getclass method...
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 21342
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 04:26 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

stored procedure return chesedi cursor (group of columns) ...resltset try chesina work out avvaledu...

we were gettng the same typecast error..
Top of pagePrevious messageNext messageBottom of page Link to this message

Triggerblaster
Side Hero
Username: Triggerblaster

Post Number: 2853
Registered: 03-2008
Posted From: 140.98.210.243

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 04:00 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

I mean Just the resultset not list of resultsets
Top of pagePrevious messageNext messageBottom of page Link to this message

Triggerblaster
Side Hero
Username: Triggerblaster

Post Number: 2852
Registered: 03-2008
Posted From: 140.98.210.243

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 03:58 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

Native query use cheste resultset vastadi not list
Top of pagePrevious messageNext messageBottom of page Link to this message

Cyberabadsinnodu
Side Hero
Username: Cyberabadsinnodu

Post Number: 8498
Registered: 02-2010
Posted From: 67.163.149.59

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 03:56 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Saint:

List<state> states= null;


List<resultset>kada pettalsindhi...a result set lo objects untayi ga...then iterate thru them?
ROM lo undi DB ni prawxy lo chuse mahanubavulu kosam ee signature
Top of pagePrevious messageNext messageBottom of page Link to this message

Saint
Megastar
Username: Saint

Post Number: 21341
Registered: 01-2011
Posted From: 12.22.163.132

Rating: N/A
Votes: 0 (Vote!)

Posted on Friday, September 13, 2013 - 03:43 pm:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

Oracle Stored fucntion emnativequery use chesi call chesthunna..it returns a cursor...

I could execute it successfully but while reading the List it complains

oracleresultsetimpl cannot type cast to java.lang.string or hash or list...

sare ani aa SP return chesthe DB object class loki read chesthunna avvatam ledu..it throws an exception...

ela fix cheyyali ee issue?

EntityManager em = this.em;
List<state> states= null;
try {
Query query = em.createNativeQuery

Add Your Message Here
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image HASH(0x993041c){Movie Clipart}
Show / hide regular icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

 N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Show / Hide Filmy icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

 N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: