Hi all,
A basic question
An Entity EJB always has to have a data map, (a table) existing in some database somewhere, i.e. you cannot create an Entity Bean without creating a place where it can persist it's data.....and this always has to be a database.
Correct?
-
Basic Q? (3 messages)
- Posted by: Stephen Bennett
- Posted on: June 20 2001 06:21 EDT
Threaded Messages (3)
- Basic Q? by ravi kiran on June 20 2001 07:21 EDT
- Basic Q? by Albert Zamus on June 20 2001 09:25 EDT
- Basic Q? by Rich Boyde on June 20 2001 13:03 EDT
-
Basic Q?[ Go to top ]
- Posted by: ravi kiran
- Posted on: June 20 2001 07:21 EDT
- in response to Stephen Bennett
hi ben,
you can create an entity which dont have any container managed fields or persistant fields that is it does'nt save its state to database rather try to retain it in server till
it is existing or live.
bye,
Rk. -
Basic Q?[ Go to top ]
- Posted by: Albert Zamus
- Posted on: June 20 2001 09:25 EDT
- in response to Stephen Bennett
An entity bean as the same suggests has to map to a ER model. So it has to have persistent fields. If you feel you dont need to save the fields make it a session bean instead!
I am not sure whether it HAS to be a database. Perhaps you could serialize the fields to a file. -
Basic Q?[ Go to top ]
- Posted by: Rich Boyde
- Posted on: June 20 2001 13:03 EDT
- in response to Stephen Bennett
A Bean Managed Entity bean does not have to map to a database, the container will still call ejbLoad, ejbStore when it thinks it needs you to read or write the information to persistent storage. I am not sure what you would gain by having it not map to persistent storage but you could do it. If you want static data that every session access I would keep in a properties file (ie a startup class) or hook it to the JNDI tree.
rich