categoryDAO_mssql

Package: machii_info_sample.model.category
Inherits from: model.category.categorydao
Method Summary
public void create(category category)

CRUD method

Methods inherited from model.category.categorydao:   update , read , init , delete
Method Detail
create

public void create( category category )

CRUD method

Parameters:
category category

Code:

	<cffunction name="create" returntype="void" output="false" hint="CRUD method">
		<cfargument name="category" type="machii_info_sample.model.category.category" required="yes" displayname="create" hint="I am the faq from which to create a record" />
		<cfset var categoryInsert = 0 >				
		<cfquery name="categoryInsert" datasource="#variables.dsn#" >
			SET NOCOUNT ON
			INSERT INTO categories (
				name,				
				sortOrder
			) VALUES (
				'#trim(arguments.category.getName())#',
				<cfqueryparam cfsqltype="CF_SQL_BIGINT" value="#arguments.category.getSortOrder()#" >
			)
			SELECT @@identity AS categoryID
			SET NOCOUNT OFF
		</cfquery>
		<cfset arguments.category.setCategoryID(categoryInsert.categoryID) >
		<cfreturn />
	</cffunction>