470,833 Members | 1,985 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

EJB array fields

Hi everybody.

I have to make an entity EJB, one field of which should be an array of
Strings (for instance a Car EJB and one field should be a list of people who
have permission to use it).

Can somebody tell me in a few words what's the best way to model this?
Jul 17 '05 #1
2 2193

"Much as some folks hate to lose their way, me, I pray to God that I will."

"baba" <ba*************@yahoo.com> wrote in message
news:ci**********@bagan.srce.hr...
| Hi everybody.
|
| I have to make an entity EJB, one field of which should be an array of
| Strings (for instance a Car EJB and one field should be a list of people
who
| have permission to use it).
|
| Can somebody tell me in a few words what's the best way to model this?
|
|
You cannot have an array of Strings as a property of a CMP EJB, you will
need to create a PersonEJB and set up a one-to-many relationship from your
CarEJB to your PersonEJB.

Do you really need EJB for this? EJB is quite invasive of your code & quite
an overhead for something this simple. Have you looked at other persistence
mechanisms? Hibernate would be ideal for this http://www.hibernate.org/

--
-P
"Much as some folks hate to lose their way, me, I pray to God that I will."
Jul 17 '05 #2
Apologies for leaving part of my sig at the top of the last mail :-) In case
this threw you & you didn't scroll down to my answer, I've posted it again
here :-)

| You cannot have an array of Strings as a property of a CMP EJB, you will
| need to create a PersonEJB and set up a one-to-many relationship from your
| CarEJB to your PersonEJB.
|
| Do you really need EJB for this? EJB is quite invasive of your code &
quite
| an overhead for something this simple. Have you looked at other
persistence
| mechanisms? Hibernate would be ideal for this http://www.hibernate.org/
|
| --
| -P
| "Much as some folks hate to lose their way, me, I pray to God that I
will."
|
|
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Paul Kirby | last post: by
4 posts views Thread by Michael Kirchner | last post: by
4 posts views Thread by Mark Hannon | last post: by
19 posts views Thread by MMMMM | last post: by
11 posts views Thread by Geagleeye | last post: by
reply views Thread by josh.23.french | last post: by
2 posts views Thread by yeshello54 | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.