• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

EJB Problem  RSS feed

Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm with a strange problem, that i can't find a solution for, even though it sound like a pretty standard thing

I have a CMP that has a CMR (1:N) with another CMP
Let's say that a Customer has a CMR with CustomerHistory (that is, a Customer has many CustomerHistory items)
Customer has a simple PK (a Long Type ID)
CustomerHistory has a composed PK (a Long Type CustomerID and a Long Type Version)

Well in here lies the problem, because in CustomerHistory, CustomerID is part of the Primary Key, and also is the Foreign Key to Customer

Because of that (or at least i think it's because of that)
When i'm in a CustomerBean and i try to get All the CustomerHistoryBean that are associated with this Customer i get a Collection of NULLs
What is more strange is that i get a correct number of NULL objects, that is, if in a Customer i have 5 CustomerHistorys related, i get a Collection with 5 NULLs

Anyone knows how can i solve this ?

In my Database i have other tables with other relations, and all of them work fine because all of them have simple PKs, except for this one, which is the one that doesn't work

Any help would be appreciated

Thanks in advanced
Safin Ahmed
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So i found out the real problem
And the problem is that my CustomerHistory has a Text Field, as in a MS SQL Server TEXT Field
When i changed it to a VARCHAR, it started working
The strangest thing is that Customer also has a TEXT Field (mapped to a String) and i can do Finds without any problems

So my question now is how can i work with TEXT in CMPs ?

Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
Enterprise Java integration with Delphi and Free Pascal applications - new release 2019.02
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!