Re: [jBoss-User] create() of CMP entitybean

2000-10-24 Thread Rickard Öberg

Alexander ten Bruggencate wrote:
> > Id generation is very application specific, which is why you have to
> > deal with it yourself. That said, this is a common need with common
> > solutions. Look in the "jbosstest" module which has an id generator. You
> > would also do well to read the id generation discussion at
> > theserverside.com which has many good pointers.
> 
> i've searched the jboss src dir but i couldn't find the generator you
> are talking about, can you be more specific?

It is in the "jbosstest" CVS module.

http://www.jboss.org/cvs.htm

/Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com



--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] create() of CMP entitybean

2000-10-24 Thread Alexander ten Bruggencate

Rickard Öberg wrote:
 
> Id generation is very application specific, which is why you have to
> deal with it yourself. That said, this is a common need with common
> solutions. Look in the "jbosstest" module which has an id generator. You
> would also do well to read the id generation discussion at
> theserverside.com which has many good pointers.

i've searched the jboss src dir but i couldn't find the generator you
are talking about, can you be more specific?

-Alexander.


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] create() of CMP entitybean

2000-10-24 Thread Alexander ten Bruggencate

Rickard Öberg wrote:
> 
> Hi!
> 
> Alexander ten Bruggencate wrote:
> > > Id generation is very application specific, which is why you have to
> > > deal with it yourself. That said, this is a common need with common
> > > solutions. Look in the "jbosstest" module which has an id generator. You
> > > would also do well to read the id generation discussion at
> > > theserverside.com which has many good pointers.
> >
> > Ah, i'm beginning to see the picture, i'll do what you suggest.
> 
> Good!
> 
> To be even more precise, CMP is about *persisting data*, not *generating
> data* which is what you want. Remember that a primary key can be an
> email address, and how do you generate that generically...? (Rhetoric
> question)
> 
> /Rickard

yes, rub it in some more... :-)
it's just that the example i read from Richard Monson-Haefel's book
doesn't use a factory class to do that stuff which in turn gave me the
impression that cmp could be used for that.
Well, it's back to the drawing board for me!

-Alexander.

Ps. did i thank you for your help? if not thnx...


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] create() of CMP entitybean

2000-10-24 Thread Rickard Öberg

Hi!

Alexander ten Bruggencate wrote:
> > Id generation is very application specific, which is why you have to
> > deal with it yourself. That said, this is a common need with common
> > solutions. Look in the "jbosstest" module which has an id generator. You
> > would also do well to read the id generation discussion at
> > theserverside.com which has many good pointers.
> 
> Ah, i'm beginning to see the picture, i'll do what you suggest.

Good!

To be even more precise, CMP is about *persisting data*, not *generating
data* which is what you want. Remember that a primary key can be an
email address, and how do you generate that generically...? (Rhetoric
question)

/Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com



--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] create() of CMP entitybean

2000-10-24 Thread Alexander ten Bruggencate

Rickard Öberg wrote:

> Id generation is very application specific, which is why you have to
> deal with it yourself. That said, this is a common need with common
> solutions. Look in the "jbosstest" module which has an id generator. You
> would also do well to read the id generation discussion at
> theserverside.com which has many good pointers.

Ah, i'm beginning to see the picture, i'll do what you suggest.
thank you.

-Alexander.


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] create() of CMP entitybean

2000-10-24 Thread Rickard Öberg

Hi!

Alexander ten Bruggencate wrote:
> i understand they must have the same parameters, but i want the
> container to DYNAMICLY assign an ID on creation.

I understand that you want that, but that's not how it works.

> for example: if the ID is an int then how possibly can i, the developer,
> know the next possible free ID?

By making an id factory that generates the id for you.

> I don't even WANT to know the next possible free ID. That's what CMP is
> for.

No, that is not what CMP is for. 

Id generation is very application specific, which is why you have to
deal with it yourself. That said, this is a common need with common
solutions. Look in the "jbosstest" module which has an id generator. You
would also do well to read the id generation discussion at
theserverside.com which has many good pointers.

> from what I understand this is possible, 

Sorry, but your understanding is wrong. You have to do it yourself.

/Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com



--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] create() of CMP entitybean

2000-10-24 Thread Alexander ten Bruggencate

Rickard Öberg wrote:
> 
> Hi!
> 
> Alexander ten Bruggencate wrote:
> >
> > I'm having trouble creating and instance of my homemade PersonBean.
> > The problem is that i want cmp to instanciate the primary key.
> >
> > All i want to do is call ejbCreate(), i think my xml files are set up
> > correctly it's just that i don't have examples how _exactly_ my bean
> > constructor should look like.
> 
> You are in charge of creating id's. The ejbCreate() method must have the
> same parameters as the create() method in the home interface.
> 

Hi,

i understand they must have the same parameters, but i want the
container to DYNAMICLY assign an ID on creation.
for example: if the ID is an int then how possibly can i, the developer,
know the next possible free ID?
I don't even WANT to know the next possible free ID. That's what CMP is
for.

from what I understand this is possible, i'm hoping someone on this list
would be kind enough to provide an example bean+home+interface

-Alexander.


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] create() of CMP entitybean

2000-10-24 Thread Rickard Öberg

Hi!

Alexander ten Bruggencate wrote:
> 
> I'm having trouble creating and instance of my homemade PersonBean.
> The problem is that i want cmp to instanciate the primary key.
> 
> All i want to do is call ejbCreate(), i think my xml files are set up
> correctly it's just that i don't have examples how _exactly_ my bean
> constructor should look like.

You are in charge of creating id's. The ejbCreate() method must have the
same parameters as the create() method in the home interface.

/Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com



--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]