Any help is appreciated.
The error is: The setIsNew package method in the
D:\public\data\intranet\gov\epa\rtp\OnlineTraining\Trainee\Trainee.cfc
component cannot be accessed from
D:\public\data\intranet\gov\epa\rtp\onlineTraining\Trainee\TraineeDao.cfc.
I cannot reproduce this error.
TraineeDao.cfc and Trainee.cfc both reside in
gov.epa.rtp.onLineTraining.Trainee
Trainee.cfc inherits "setIsNew" from gov.epa.rtp.lang.bean
Here is the code:
<cffunction name="create" output="false"
returnType="gov.epa.rtp.OnlineTraining.Trainee.Trainee">
<cfargument name="trainee"
type="gov.epa.rtp.OnlineTraining.Trainee.Trainee" required="true"
hint="Trainee Bean" />
<!--- create a local scope --->
<cfset var local = structNew() />
<!--- Encase KEY_VALUE and INSERT Trainee SQL in a cftransaction
--->
<cftransaction>
<!--- Set Primary key to next available number --->
<cfset arguments.trainee.setTraineeId( getNextKeyValue('Trainee')
) />
<!--- first lets validate this Trainee --->
<cfif not arguments.Trainee.validate()>
<!--- if Trainee isn't valid, throw an error --->
<cfthrow type="Trainee.InvalidTrainee"
message="The Trainee passed into
TraineeDao.create() is not a valid Trainee object." />
</cfif>
<cftry>
<cfquery name="local.createTrainee"
datasource="#getDatasource().getName()#">
INSERT INTO TRAINEE
(
TRAINEE_ID,
LOCATOR_ID
)
VALUES
(
<cfqueryparam
value="#arguments.trainee.getTraineeId()#" cfsqltype="CF_SQL_NUMERIC">,
<cfqueryparam
value="#arguments.trainee.getLocatorId()#" cfsqltype="CF_SQL_NUMERIC">
)
</cfquery>
<cfcatch type="Any">
<cfthrow type="Trainee.create"
detail="#cfcatch.detail#"
errorcode="#cfcatch.errorcode#"
message="#cfcatch.message#"
extendedinfo="#cfcatch.extendedInfo#">
</cfcatch>
</cftry>
</cftransaction>
<!--- update the isNew status to false --->
<cfset arguments.trainee.setIsNew(false)>
<cfreturn arguments.trainee />
</cffunction>
______________________________________________________________________
Ed Szwedo
Web Development Team Lead
CSC
109 TW Alexander Drive, Building NCC, Mail Drop N176-05, Research Triangle
Park, NC 27711
Information Technology Infrastructure Solutions | Office: (919)541-3955 |
Fax: (919)541-3641 | [email protected] | www.csc.com
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------