cancel
Showing results for 
Search instead for 
Did you mean: 

Create Entity Bean Problem

Former Member
0 Kudos

Hi All,

I use Entity Bean's createMethod in a Session Bean BusinessMethod.

If only create one EB (count=1), it can run.

but i want to create multi-EBs(count>1),it can not run.

Education_JB[] arg1;

for (int i = 0; i <count ; i++) {

String EID = generateId();

String arg2 = arg1<i>.getEmployeeID();

String arg3 = arg1<i>.getEducationLevel();

String arg4 = arg1<i>.getSchoolAttended();

String arg5 = arg1<i>.getLocation();

String arg6 = arg1<i>.getMajorField();

String arg9 = arg1<i>.getGraduated();

educationhome.create(EID, arg2, arg3, arg4, arg5, arg6, datearg7, datearg8, arg9);

}

please help me.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Well, not entirely sure what you're trying to do, but for starters you're not referencing the position in the array properly:

Education_JB[] arg1;

for (int i = 0; i < arg1.length ; i++) {
 String EID = generateId();
 String arg2 = arg1<i>.getEmployeeID();
 String arg3 = arg1<i>.getEducationLevel();
 String arg4 = arg1<i>.getSchoolAttended();
 String arg5 = arg1<i>.getLocation();
 String arg6 = arg1<i>.getMajorField();
 String arg9 = arg1<i>.getGraduated(); 
 educationhome.create(EID, arg2, arg3, arg4, arg5, arg6, datearg7, datearg8, arg9);
}

Try that and see if it helps.

Cheers,

Dion

Former Member
0 Kudos

the < i > should be [ i ] (without the spaces)

SDN changed it.

Dion

Former Member
0 Kudos

Dear Dion

Thanks for your help.

But it still has problem in educationhome.create();

Message was edited by:

WU WENJR

Former Member
0 Kudos

To be able to help you, you need to provide us with a lot more information. Simply writing that the create methid returns an error is nowhere near enough information for us make an educated guess where the problem might be.

If you are unsure please read through the rules of engagement for this forum.

Dion

Former Member
0 Kudos

Dear Dion ,

I find the problem.

The function "generateId()" create the same value,

and the EID is primary key.

So, i modify the "generateId()" , and it can run.

Thanks for your advice.