This website is intended as archive for old content and forums.
Please visit http://opf3.codeplex.com for the project's new website.

Oracle

Oracle web site

Info

Class name: OracleStorage
Namespace: Chili.Opf3.Storages.Oracle
Current version: 1.0.6.

How to use it

This short example demonstrates how to use the storage in your code.

C#  VB.NET  
// Create the instance of the Oracle storage.
Oracle storage = new Oracle("user", "password", "host");
// Set it as storage of the ObjectContext.
ObjectContext context = 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 sequence in care of the autoincrement
// values. This sequence must be defined in the database.
// {0} stands for the name of the entity.
// {1} stands for the name of the field.
storage.SequenceFormat = "{0}_{1}_SEQUENCE";

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 sequence is generated.
You may also add {1} which is then the name of the field for which the sequence is created.

When specifying the sequence format as "{0}_{1}_SEQUENCE" for a persistent class mapped to the NEWS entity and the autoincrement field with name ID you need to generate the following sequence in the database: NEWS_ID_SEQUENCE. The sequence format needs only to be specified once. You need to create for each persistent object type with an AutoNumber a sequence (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.