
603
DEVELOPING
COLDFUSION 9 APPLICATIONS
ColdFusion ORM
Las
t
upda
te
d 8/5/2010
index.cfm
<cfoutput>Original Data<br></cfoutput>
<cfset artistObj = EntityLoad("artists", 1, true)>
<cfoutput>#artistObj.getArtistID()# | #artistObj.getFirstName()# |
#artistObj.getLastName()#<br></cfoutput>
<cfset artObj = artistObj.getart()>
<cfoutput>#artObj[1].getartname()# <br></cfoutput>
<cfset authorObj = EntityLoad("authors", 1, true)>
<cfoutput>#authorObj.getFirstName()#</cfoutput>
<cfoutput>#authorObj.getLastName()#</cfoutput>
ORM Function enhancements
Multiple data source support impacts the following ORM functions:
ORMGetSession
Description
Returns the Hibernate session associated with the data source in the request. If ORM is not configured for this data
source, it results in an exception. If data source is not specified, the Hibernate session of the default data source is
returned.
Use this session object to call the APIs, which, otherwise, ColdFusion does not expose.
For information on session APIs, see:
http://docs.jboss.org/hibernate/core/3.3/api/org/hibernate/Session.html
Function syntax
ormgetsession([datasource])
ORMCloseSession
Description
Closes the Hibernate session associated with the data source in the request. If you do not specify a data source, the
Hibernate session associated with the default data source is closed.
Function syntax
ormclosesession([datasource])
ORMCloseAllSessions
Description
Closes all Hibernate sessions in the request.
Function Syntax
ormcloseallsessions()
History
ColdFusion 9 Update 1: Added this function
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...