Archive

Archive for December, 2009

CodeFluent Entities 2009 Achievements

December 30, 2009 Leave a comment

Hi all,

Now is the time to list what has been added to the product this year!

Producers:

  • Microsoft SharePoint WebParts producer 2.0 (great enhancements at runtime)
  • Oracle Database producer 1.0 (beta)
  • Smart Client producer 1.0 (beta)
  • MSBuild producer 1.0
  • Patch producer 1.0
  • Microsoft Silverlight 2 support for Service Model (SCOM) producer
  • Microsoft Silverlight 3 support for Service Model (SCOM) producer
  • Microsoft Silverlight 4 (beta) support for Service Model (SCOM) producer

Importers:

  • Sparx Systems Enterprise Architect importer 1.0 (beta)

Others:

  • A lot of effort has been put into documentation
  • SQL 2008 support (geography, hierarchyid, geometry types, importer, …)
  • Access 2007 synchronization support
  • CodeFluent Entities 64 bits native version (WOW support has always been there)
  • Enhancements to the CodeFluent Entities Model (including Lightweight entities)
  • Blob import enhancements for all importers (including Access OLEObjects)
  • Xml documentation is now generated by BOM producer
  • New Starter Wizard tool has been added
  • New UrlValidate & EmailValidate rules
  • New TextSearch pattern

Phew! We really did all that, plus some more, less visible enhancements and bug fixes (it happens!). We also worked a lot on the CodeFluent Entities graphical modeling tool, integrated with Microsoft Visual Studio 2008, and this is not yet visible…

As always, you can track the latest changes, from a technical perspective, here http://www.codefluent.com/builds/history.htm

CodeFluent Entities R&D team.

Categories: News Tags:

CodeFluent Entities Oracle Producer is available (in Beta)!

December 18, 2009 Leave a comment

Hi everyone,

This long awaited persistence layer producer is now available for our customers. So there are now two persistence producers available from us: Microsoft SQL Server (supporting versions 2000, 2005 and 2008), and Oracle Database (supporting versions 10 and 11).

The Oracle producer is very logically comparable to the SQL Server one, in terms of features. It is capable of generating SQL scripts for:

  • Schema/Users
  • Tables
  • Constraints (primary and foreign keys)
  • Views
  • Procedures (and associated Oracle Packages)
  • Sequences (for auto numbering support)
  • Instances (including CodeFluent blob objects)

The beta version of this producer is missing one cool feature though: the difference engine. Today, it drops and recreates tables at each generation. However, this can be mitigated by the use of CodeFluent Entities instances.

As a funny example, we have converted the Access Northwinds database into an SQL Server and an Oracle Northwinds database without writing a single line of code, using some cool CodeFluent Entities features.

This is an image of the original unmodified Access database:

The first action was to use the CodeFluent Entities Access Importer. This has created a CodeFluent Entities model, shown here using the CodeFluent Entities Portable Editor (not yet released!):

Then, we used simultaneously the SQL Server and the Oracle producer on the CodeFluent Entities model. This is a diagram of the generated schema shown in SQL Server Enterprise Manager:

And this is a screenshot of Oracle’s SQL Developer, displaying the generated database:

Although CodeFluent Entities is *not* an import/export tool, it does help for interoperability scenarios!

Some key points to emphasize:

  • The process used here is not a “simple” database-to-database import. It is a database-to-model-to-database generation. Oracle or SQL Server are not aware about Access here. The model could be modifed to suit any needs.
  • The CodeFluent Entities Access importer is capable of extracting Access OLE Objects and transforming them into CodeFluent Entities blob instances. Because SQL Server and Oracle producers are both capable of saving CodeFluent Entities instances, including blob instances, they are also imported into the generated databases. We can clearly check this in the last screenshot (using SQ Developer builtin blob/image visualization feature) showing an image blob that existed in the original Access database.

The Oracle producer is available in latest CodeFluent builds, starting from today, here “http://www.codefluent.com/builds/Latests/”

The documentation has not yet been updated for the Oracle producer, so if you need it, please contact us at support@softfluent.com.

CodeFluent Entities R&D team.

Categories: News

SQL Hints

December 14, 2009 1 comment

CodeFluent Entities allows developers to specify SQL specific hints on its methods.

For instance, doing as so:

<cf:project xmlns:cf=“http://www.softfluent.com/codefluent/2005/1″
            xmlns:cfps=“http://www.softfluent.com/codefluent/producers.sqlserver/2005/1″>

 <Customer>
    <Id />
    <Name />
    <cf:method name=“LoadByName”
            body=“load(string name) Where Name=@name” cfps:tableHint=“NOLOCK“ />
 </Customer>
</cf:project>

Will generate a T-SQL stored procedure with the NOLOCK hint applied to the Customer table.

A recurring question that we have is “which SQL Server hints does CodeFluent support?“. Well the answer is very straightforward: all of them! Since, the applied hint isn’t inferred from the specified value, it means that regarding CodeFluent, you could specify anything! All that matters is that the specified hint is actually supported by the targeted platform.

For an exhaustive hint list, please check-out your SQL Server’s corresponding documentation:

CodeFluent Entities R&D Team

CodeFluent Entities and the SqlGeography Type

December 14, 2009 Leave a comment

Although there is not a geography type in CodeFluent Entities (as this is too specific to SQL Server 2008), you can still use the new SQL 2008 geography type today.

First you need to declare the target type in the CodeFluent Entities SQL Server Producer (with the ‘cfps:dataType’ attribute). Then, optionally, you can declare a computed companion property that will hold the data as the corresponding SQL Server 2008 .NET Type: SqlGeography.

It will work because these types can be transferred back and forth as arrays of bytes. Here is a sample model that does it:

Code:

<cf:project xmlns:cf="http://www.softfluent.com/codefluent/2005/1"
                   defaultNamespace="Test"
                   xmlns:cfps="http://www.softfluent.com/codefluent/producers.sqlserver/2005/1">

 <Address>
  <Id />
  <RawSpatialLocation cfps:dataType="geography" typeName="byte[]" maxLength="-1" />
  <SpatialLocation typeName="Microsoft.SqlServer.Types.SqlGeography" persistent="false">
  <cf:rule typeName="OnGet" />
  <cf:rule typeName="OnAfterSet" />
  <cf:snippet name="SpatialLocation">

 private void OnGetSpatialLocation()
 {
  _spatialLocation = new Microsoft.SqlServer.Types.SqlGeography();
  using (System.IO.MemoryStream stream = new System.IO.MemoryStream(RawSpatialLocation))
  {
   using (System.IO.BinaryReader reader = new System.IO.BinaryReader(stream))
   {
    _spatialLocation.Read(reader);
   }
  }
 }

 private void OnAfterSetSpatialLocation(Microsoft.SqlServer.Types.SqlGeography spatialLocation)
 {
  using (System.IO.MemoryStream stream = new System.IO.MemoryStream())
  {
   using (System.IO.BinaryWriter writer = new System.IO.BinaryWriter(stream))
   {
    _spatialLocation.Write(writer);
    _rawSpatialLocation = stream.ToArray();
   }
  }
 }
  </SpatialLocation>
 </Address>
</cf:project>

NOTE1: make sure Microsoft.SqlServer.Types.dll is referenced for the project to compile.

NOTE2: all this is valid for the SqlGeography, SqlGeometry and SqlHierarchyId types.

The next version of CodeFluent Entities will allow you to directly declare this:

Introduced with the latest CodeFluent Entities build (B31218), you can now do this:

Code:

<cf:project xmlns:cf="http://www.softfluent.com/codefluent/2005/1"
                  defaultNamespace="Test"
                  xmlns:cfps="http://www.softfluent.com/codefluent/producers.sqlserver/2005/1"
                  assemblyPaths="c:\temp\Microsoft.SqlServer.Types.dll"> <!-- adapt this to your machine -->

 <Address>
  <Id />
  <SpatialLocation cfps:dataType="geography" typeName="Microsoft.SqlServer.Types.SqlGeography, Microsoft.SqlServer.Types" />
</Address>
</cf:project>

CodeFluent Entities R&D Team

Business Object Model Now Supports Oracle Databases

December 8, 2009 Leave a comment

Support of Oracle Databases at Business Object Model (BOM) level was now added using Microsoft’s (System.Data.OracleClient) and Oracle’s (Oracle.DataAccess.Client) providers.
To enable this support, neither extra attributes nor any modifications in the BOM are required: all one needs to do is to update its connection string declaration.

Example:

  1. .NET Oracle Provider:
    <[DefaultNamespace] persistenceTypeName="System.Data.OracleClient.OracleConnection, System.Data.OracleClient"
    connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MYORACLESERVER)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XE)));user id=HR;password=hr" />
  2. ODP.NET Oracle Provider:
    <[DefaultNamespace] persistenceTypeName="Oracle.DataAccess.Client.OracleConnection, Oracle.DataAccess.Client"
    connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MYORACLESERVER)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XE)));user id=HR;password=hr" />

The CodeFluent Entities Runtime will automatically add the cursor parameter which is required to read Oracle Server procedures.

Even though the Oracle Server Producer is still on its way, this provides a way to map a generated BOM onto an Oracle persistence layer.

CodeFluent Entities R&D Team

Categories: News, Oracle Database
Follow

Get every new post delivered to your Inbox.

Join 49 other followers