Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

CMP findBy

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
i'm using Sun Studio Enterprise 8
And i've used it to create two CMPs from Database
They have a relationship 1-N, that is, one Customer has N CustomerHistory

In the Customer CMP everything is OK
In the CustomerHistory CMP when i do a findBy(any field) i get a Collection with nulls
the number of elements in the Collection is correct but every element is a null
What can be happening here?

The IDE generated everything for me, so i think the configuration files are pretty much OK
The CustomerHistory table has a Primary Key with 2 fields, i don't know if that can be a problem, but i don't think so

Any ideas ?

Thanks
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Safin

I think there will be error of database connectivity pool you try for this if again find any problem then there may other option if not successful then say it

Regards
Rajesh Pandey
email :- rajesh-pandey@hotmail.com
A freelance software Developer
India Delhi
 
Safin Ahmed
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all thanks for the reply

I've figured out that the problem is because I have a Customer with a Collection of CustomerHistory

and CustomerHistory has a compound Primary Key (id and version), and the ID is the foreign key to the Customer
That's why everything comes nulled, i've tried with other 1-N relations, and all of them worked (because all of them have simple keys)

Thanks
 
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic