Firebird Info Class name: FirebirdStorage Namespace: Chili.Opf3.Storages.Firebird Current version: 1.0.5. How to use it This short example demonstrates how to use the storage in your code. | C# VB.NET | // Create the instance of the Firebird storage. FirebirdStorage storage = new FirebirdStorage( "User=user;Password=pass;Database=database.fdb;DataSource=localhost;"); // Set it as storage of the ObjectContext. ObjectContext context = new ObjectContext(storage); ' Create the instance of the Firebird storage. Dim storage As New FirebirdStorage( _ "User=user;Password=pass;Database=database.fdb;DataSource=localhost;") ' Set it as storage of the ObjectContext. Dim context As New ObjectContext(storage) | How to make the storage work with autoincrement values This short example shows how to make the storage work with the AutoNumber (autoincrement) properties of the FieldAttribute. | C# VB.NET | // Specifies the generator in care of the autoincrement // values. This generator must be defined in the database. // {0} stands for the name of the entity. // {1} stands for the name of the field. storage.GeneratorFormat = "{0}_{1}_GEN"; ' Specifies the generator in care of the autoincrement ' values. This generator must be defined in the database. ' {0} stands for the name of the entity. ' {1} stands for the name of the field. storage.GeneratorFormat = "{0}_{1}_GEN" | The format should be specified immediately after the instance of the storage class is created. {0} stands for the name of the entity for which this generator is generated. You may also add {1} which is then the name of the field for which the generator is created. When specifying the generator format as "{0}_{1}_GEN" for a persistent class mapped to the NEWS entity and the autoincrement field with name ID you need to generate the following generator in the database: NEWS_ID_GEN. The generator format needs only to be specified once. You need to create for each persistent object type with an AutoNumber a generator (fulfilling the specified format) in the database. Download This storage is part of the Opf3 Framework package (supported out of the box). Download the Opf3 Framework demo version to try it. If you have any questions or need further assistance, please contact us. |