Skip to content
Paul Lefebvre edited this page Aug 29, 2014 · 4 revisions

The DBObjectFactory is used by the framework to instantiate classes for you. In particular it is used by the GetAll method. In your application initialization you will want to add each of your DBObject subclasses to the factory.

Methods

AddClassToMap(dbo As DBObject)

Use this method to add a class to the Factory. The dbo parameter must be a non-Nil class instance:

Dim t As New Team
Storm.DBObject.Factory.AddClassToMap(t)

AddClassToMap(ti As Introspection.TypeInfo)

Use this method to add a class to the Factory:

Storm.DBObject.Factory.AddClassToMap(GetTypeInfo(Team))

CreateNewInstance(type As String, ID As Int64, dbConn As DBConnection = Nil) As DBObject

Creates a new instance of a class by supplying the class name as a string and the primary key as an integer:

Dim dbo As Storm.DBObject
dbo = DBObject.Factory.CreateNewInstance(“team”, 1)