when we call EJBCreate() in CMP,the container will insert a new record into database .yet sometimes we just want to get or view some records ,what we can do ????????????
thanks a lot
Discussions
EJB programming & troubleshooting: how to create a new Entity Bean without insert a new record
-
how to create a new Entity Bean without insert a new record (6 messages)
- Posted by: javaflyers xx
- Posted on: December 22 2003 05:30 EST
Threaded Messages (6)
- how to create a new Entity Bean without insert a new record by stephen smithstone on December 22 2003 05:33 EST
- how to create a new Entity Bean without insert a new record by javaflyers xx on December 22 2003 05:44 EST
-
how to create a new Entity Bean without insert a new record by stephen smithstone on December 22 2003 05:49 EST
-
how to create a new Entity Bean without insert a new record by javaflyers xx on December 22 2003 06:17 EST
-
how to create a new Entity Bean without insert a new record by stephen smithstone on December 22 2003 06:33 EST
- how to create a new Entity Bean without insert a new record by javaflyers xx on December 22 2003 07:23 EST
-
how to create a new Entity Bean without insert a new record by stephen smithstone on December 22 2003 06:33 EST
-
how to create a new Entity Bean without insert a new record by javaflyers xx on December 22 2003 06:17 EST
-
how to create a new Entity Bean without insert a new record by stephen smithstone on December 22 2003 05:49 EST
- how to create a new Entity Bean without insert a new record by javaflyers xx on December 22 2003 05:44 EST
-
how to create a new Entity Bean without insert a new record[ Go to top ]
- Posted by: stephen smithstone
- Posted on: December 22 2003 05:33 EST
- in response to javaflyers xx
dont call the create method use the findByPrimaryKey method -
how to create a new Entity Bean without insert a new record[ Go to top ]
- Posted by: javaflyers xx
- Posted on: December 22 2003 05:44 EST
- in response to stephen smithstone
hi,
stephen,thanks a lot !
Can findByPrimaryKey() CREATE a new Entity Bean???? if we have none Entity Beans at first? -
how to create a new Entity Bean without insert a new record[ Go to top ]
- Posted by: stephen smithstone
- Posted on: December 22 2003 05:49 EST
- in response to javaflyers xx
hi,
> stephen,thanks a lot !
>
> Can findByPrimaryKey() CREATE a new Entity Bean???? if we have none Entity Beans at first?
if you wanna do that make a method in a facade bean and then call the findByPrimaryKey and if it returns null then create a new entity bean with the key you passed to findByPrimaryKey -
how to create a new Entity Bean without insert a new record[ Go to top ]
- Posted by: javaflyers xx
- Posted on: December 22 2003 06:17 EST
- in response to stephen smithstone
hi,
stephen,thanks very much !!!!!!!!!!!!!!!!
what does that facade bean do? create a new Entity Bean?so,when that FACADE create a new Entity Bean,it will insert a new record into DB too!
so what should i do????
thanks
byw,do you get MSN? -
how to create a new Entity Bean without insert a new record[ Go to top ]
- Posted by: stephen smithstone
- Posted on: December 22 2003 06:33 EST
- in response to javaflyers xx
i think you need to re up on some j2ee design patterns and more on the EJB's session and entity -
how to create a new Entity Bean without insert a new record[ Go to top ]
- Posted by: javaflyers xx
- Posted on: December 22 2003 07:23 EST
- in response to stephen smithstone
I found some info from java.sun.com below:
There are times when you do not want to provide create methods in an entity bean's home interface. Omit the create methods when you do not want the entity bean to create persistent data. Typically in these situations, some other system or process is responsible for creating the data underlying the entity bean's persistent representation. For example, database functions insert new data into a database, and clients use the entity bean to retrieve data.
that's just what i mean.It's solution is "clients use the entity bean to retrieve data",yet ,i do not know how to retrieve data and create that Entity Bean.
:'(