This is a migrated thread and some comments may be shown as answers.

[bug?] DataStoreException because of invalid column name

6 Answers 553 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yannick
Top achievements
Rank 1
Yannick asked on 27 Jun 2014, 02:08 PM

Hi.
I got this case:
 - SQL Server 2012 R2
 - VS 2013 using Data Access

Quick description of db objects:
 Table ParamDocument (TechnicalName, Name, DisplayName)
with PK : TechnicalName
Table ParamDocumentField (Document_TechnicalName, Order, TechnicalName, Name, DisplayName, ...)
with PK : Document_TechnicalName, Order
with FK : Document_TechnicalName references ParamDocument.TechnicalName

When querying property ParamDocumentFieldEntities (IList<ParamDocumentFieldEntity> of ParamDocumentEntity, auto-generated when importing objects from db), a Telerik.OpenAccess.Exceptions.DataStoreException occurred.
As you can see in the trace below, there a 'technicalName2' used as column name in the generated SQL. This dosn't exist at all, neither in the db, nor in the EntitiesModel files (rlinq, cs).

My first analyse is:
 - this column name is used as PK in 'parent' table, but is not the one incrimned by the exception (and well named in the generated sql)
 - this column name is also existing in the child table, but not in PK / FK
 - it seems there a confusion between the child column of FK and the column used for the join in the generated SQL (because of existence of the same column name in child table + is the name of referenced column in the parent table ? )
 -there are others column names existing in both tables, but not used in FK / PK, and there's no trouble with them.

Here is the trace:
Telerik.OpenAccess.Exceptions.DataStoreException occurred
  HResult=-2146233088
  Message=Error executing query: Telerik.OpenAccess.RT.sql.SQLException: Nom de colonne non valide : 'TechnicalName2'.
Nom de colonne non valide : 'TechnicalName2'.
Impossible de préparer les instructions. ---> System.Data.SqlClient.SqlException: Nom de colonne non valide : 'TechnicalName2'.
Nom de colonne non valide : 'TechnicalName2'.
Impossible de préparer les instructions.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at OpenAccessRuntime.CommandWrapper.ExecuteReader(CommandBehavior behavior)
   at Telerik.OpenAccess.Runtime.Logging.LoggingDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader()
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.CommandImp.ExecuteReader()
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
   --- End of inner exception stack trace ---
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery(Nullable`1 commandTimeout)
   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery(Nullable`1 commandTimeout)
   at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
SQL:
SELECT b.[Document_TechnicalName] AS COL1, b.[Order] AS COL2, b.[TechnicalName2] AS COL3, b.[DisplayName] AS COL4, b.[Enabled] AS COL5, b.[Mandatory] AS COL6, b.[Name] AS COL7, b.[ReadOnly] AS COL8, b.[TechnicalName] AS COL9 FROM [ParamDocument] a LEFT JOIN [ParamDocumentField] AS b ON (a.[TechnicalName] = b.[TechnicalName2]) WHERE a.[TechnicalName] = ?                                        Telerik.OpenAccess.RT.sql.SQLException: Nom de colonne non valide : 'TechnicalName2'.
Nom de colonne non valide : 'TechnicalName2'.
Impossible de préparer les instructions. ---> System.Data.SqlClient.SqlException: Nom de colonne non valide : 'TechnicalName2'.
Nom de colonne non valide : 'TechnicalName2'.


As a workaround i renamed [ParamDocumentField].[TechnicalName] to [ParamDocumentField].[FieldTechnicalName], and everythingd going well, but it looks like there would be a bug :)

6 Answers, 1 is accepted

Sort by
0
Kristian Nikolov
Telerik team
answered on 01 Jul 2014, 10:51 AM
Hi Yannick,

Thank you for contacting us.

We attempted to reproduce the issue you are experiencing by creating a database with the described tables and then creating a Domain Model based on it. Querying the ParamDocumentFieldEntities  property threw no exceptions and the results were correct - we were not able to reproduce the exception on our side.

We would like to further investigate the situation. It is possible that the error was due to discrepancies between the model and the database schema. Looking at the provided SQL it appears that there is a column TechnicalName2 (b.[TechnicalName2] AS COL3) and another column TechnicalName (b.[TechnicalName] AS COL9) in the ParamDocumentField table. However TechnicalName2 is used for the join.

With this in mind we would recommend you use the Association Editor (double-click on the association link between the classes) to see which properties define the association between the two classes. Then you can use the Mapping Details Editor to examine whether the properties which define the association are mapped to the correct table columns. You can also use the Model Schema Explorer to see if there are any table columns which are not mapped to properties and verify that the columns are the same as the ones in your database schema.

In case this does not help you identify the source of the error, could you please provide us with the following information:
  1. Please confirm that you have used a Database First scenario to create the ParamDocumentFieldEntity and the ParamDocumentEntity persistent classes.
  2. After adding those classes to the model, have you made any modifications to them in the model or to their respective tables in the database schema?
  3. What was the exact LINQ query which caused the exception to be thrown?
  4. If possible, please send us the .rlinq file of your model in the state which used to reproduce the exception and the SQL script for the ParamDocument and ParamDocumentField  tables.

This information should help us further investigate the situation.


We are looking forward to your feedback.

Regards,
Kristian Nikolov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
Yannick
Top achievements
Rank 1
answered on 01 Jul 2014, 01:33 PM
Hi.
Thx for your reply.

As I have done a workaround by renaming the incrimined column, I'm not able to go back on the checkings your ask for (using the editors).
However, I can provide you the files stored in our svn (cs, rlinq, rling.diagram).
I can also assert you that there is no string 'TechnicalName2' in these files (insensitive casing, of course, checked using notepad++), as there is no column named like this in the database.
it is effectively what i had point out, I don't know where this 'TechnicalName2' column name is coming from.

I had imported a first version of these tables in an already existing model (by adding them), and in a second time i had modified them (with add of the various columns TechnicalName) in the database, then upgraded the model through 'Update from Database'.
The linq query :
using (EntitiesModel dbContext = new EntitiesModel(_connectionString))
{
    return dbContext.ParamDocumentEntities
       .Select(prmDocEnt => Mapper.Map<ParamDocument>(prmDocEnt))
       .ToDictionary(PrmDoc => PrmDoc.TechnicalName);
}

the sql:
CREATE TABLE [ParamDocument]
(
    [TechnicalName] [varchar](50) NOT NULL
    ,[Name] [varchar](50) NULL
    ,[DisplayName] [varchar](100) NULL
    ,CONSTRAINT [PK_ParamDocument] PRIMARY KEY CLUSTERED  ( [TechnicalName] ASC )
)
GO
CREATE TABLE [ParamDocumentField]
(
    [Document_TechnicalName] [varchar](50) NOT NULL
    ,[Order] [int] NOT NULL
    ,[FieldTechnicalName] [varchar](50) NULL
    ,[Name] [varchar](50) NULL
    ,[DisplayName] [varchar](100) NULL
    ,[Mandatory] [bit] NULL
    ,[Enabled] [bit] NULL
    ,[ReadOnly] [bit] NULL
    ,CONSTRAINT [PK_ParamDocumentField] PRIMARY KEY CLUSTERED  ( [Document_TechnicalName] ASC, [Order] ASC )
)
GO
ALTER TABLE [ParamDocumentField]
ADD CONSTRAINT [FK_ParamDocumentField_ParamDocument] FOREIGN KEY ([Document_TechnicalName]) REFERENCES [ParamDocument] ([TechnicalName])
GO

the rlinq file:
<?xml version="1.0" encoding="utf-8"?>
<DomainModel xmlns:dm0="http://schemas.microsoft.com/VisualStudio/2008/DslTools/Core" dslVersion="2.0.0.0" name="EntitiesModel" namespace="Bred.DataAccess" showPropertiesCompartment="true" xmlns="http://www.telerik.com/ORM">
  <orm:orm name="EntitiesModel" backend="mssql" default-schema="dbo" xmlns:orm="http://tempuri.org/ORM">
    <orm:namespace name="Bred.DataAccess" default="true">
      <orm:class name="BredPacketEntity" uniqueId="338149a9-9830-4d0c-a05e-3cc4139c657d">
        <orm:table name="T_SPE_Bred_Packet" />
        <orm:identity>
          <orm:single-field field-name="_noPacket" />
        </orm:identity>
        <orm:concurrency strategy="changed" />
        <orm:field name="_noPacket" property="NoPacket" behavior="readwrite" uniqueId="5ad7e165-e942-4a6a-8e72-06e9b9e874de" type="System.Int64">
          <orm:column name="no_Packet" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        </orm:field>
        <orm:field name="_codeBatch" property="CodeBatch" behavior="readwrite" uniqueId="7c3e1637-dc8c-4b0a-b301-036f8c92d8c7" type="System.String">
          <orm:column name="Code_Batch" sql-type="varchar" nullable="false" length="50" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_dateReceive" property="DateReceive" behavior="readwrite" uniqueId="3dcd7d6e-95a4-44d0-add6-3bbbfc17a430" type="System.DateTime">
          <orm:column name="dateReceive" sql-type="datetime" nullable="false" length="0" scale="0" ado-type="DateTime" />
        </orm:field>
        <orm:field name="_dateCapture" property="DateCapture" behavior="readwrite" uniqueId="1fa15951-ffb7-435f-bbf9-093dc9b3e90f" type="System.DateTime">
          <orm:column name="dateCapture" sql-type="datetime" nullable="false" length="0" scale="0" ado-type="DateTime" />
        </orm:field>
        <orm:field name="_dateEndTreatment" property="DateEndTreatment" behavior="readwrite" uniqueId="d626b880-6159-4ffc-a982-2011d20d80ee" type="System.Nullable`1[[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="dateEndTreatment" sql-type="datetime" nullable="true" length="0" scale="0" ado-type="DateTime" />
        </orm:field>
        <orm:field name="_bredDocumentEntities" property="BredDocumentEntities" behavior="readwrite" uniqueId="315aaf56-f555-4ea8-9e3c-84ab5cde72f5" type="Bred.DataAccess.BredDocumentEntity">
          <orm:collection element-class="Bred.DataAccess.BredDocumentEntity" inverse-field="_bredPacketEntity" order-by="" uniqueId="f892df1e-925c-4748-ad02-ccb5aa00fca0" />
        </orm:field>
      </orm:class>
      <orm:class name="BredDocumentMetadataEntity" uniqueId="d1de7556-8e05-4428-b8ea-fbcf645a8efc">
        <orm:table name="T_SPE_Bred_Document_Metadata" />
        <orm:identity>
          <orm:multiple-field>
            <orm:single-field field-name="_noDocument" />
            <orm:single-field field-name="_noField" />
          </orm:multiple-field>
        </orm:identity>
        <orm:concurrency strategy="changed" />
        <orm:field name="_noDocument" property="NoDocument" behavior="readwrite" uniqueId="002f2501-d00a-437f-8e90-9a55390d93ee" type="System.Int64">
          <orm:column name="no_document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        </orm:field>
        <orm:field name="_noField" property="NoField" behavior="readwrite" uniqueId="373b498d-3a04-47d7-aae6-8cb459893ba5" type="System.Int64">
          <orm:column name="no_field" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        </orm:field>
        <orm:field name="_name" property="Name" behavior="readwrite" uniqueId="5b59dab9-9679-46fc-8abd-f79a9d521675" type="System.String">
          <orm:column name="name" sql-type="varchar" nullable="false" length="200" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_value" property="Value" behavior="readwrite" uniqueId="0d289f80-21ac-4bdf-8cd6-6486f74fb00c" type="System.String">
          <orm:column name="value" sql-type="varchar" nullable="false" length="777" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_bredDocumentEntity" property="BredDocumentEntity" behavior="readwrite" uniqueId="d6a2c3c6-4ca2-49f5-b81f-c7047a013f19" type="Bred.DataAccess.BredDocumentEntity">
          <orm:reference uniqueId="9c62d97a-192d-4714-ade0-91991573fe85" association-name="BredDocumentMetadataEntityHasBredDocumentEntity">
            <orm:sharedfield name="_noDocument" target-class="Bred.DataAccess.BredDocumentEntity" target-field="_noDocument" />
            <orm:constraint name="FK_T_Bred_Document_Metadata_T_Bred_Document" delete-action="dbdefaultrule" destination-table="T_SPE_Bred_Document" />
          </orm:reference>
        </orm:field>
        <orm:index name="idx_T_SPE_Brd_Dcmnt_Mtdt_n_dcm">
          <orm:columnMapping>
            <orm:column name="no_document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
          </orm:columnMapping>
        </orm:index>
      </orm:class>
      <orm:class name="BredDocumentImageEntity" uniqueId="36558e49-4f01-4e6d-8635-23db01d755ce">
        <orm:table name="T_SPE_Bred_Document_Image" />
        <orm:identity>
          <orm:multiple-field>
            <orm:single-field field-name="_noDocument" />
            <orm:single-field field-name="_noImage" />
          </orm:multiple-field>
        </orm:identity>
        <orm:concurrency strategy="changed" />
        <orm:field name="_noDocument" property="NoDocument" behavior="readwrite" uniqueId="dc669f1d-c006-4591-b550-4b5a0053fcb4" type="System.Int64">
          <orm:column name="no_document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        </orm:field>
        <orm:field name="_noImage" property="NoImage" behavior="readwrite" uniqueId="241af854-af6f-4c30-b681-b7578e0468e7" type="System.Int64">
          <orm:column name="no_image" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        </orm:field>
        <orm:field name="_noFieldMeta" property="NoFieldMeta" behavior="readwrite" uniqueId="35f61519-824d-4a14-a705-73a2962fcdb0" type="System.Int32">
          <orm:column name="no_field_meta" sql-type="int" nullable="false" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_idDisk" property="IdDisk" behavior="readwrite" uniqueId="2cb5d96f-e8a9-4fd9-a53a-8a3b81093f5b" type="System.Int32">
          <orm:column name="idDisk" sql-type="int" nullable="false" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_imagepath" property="Imagepath" behavior="readwrite" uniqueId="ae2bf6db-040a-439b-b277-c13202ebbe79" type="System.String">
          <orm:column name="Imagepath" sql-type="varchar" nullable="false" length="2000" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_imageFileName" property="ImageFileName" behavior="readwrite" uniqueId="08b97f8d-fd5e-4671-a5cc-2942542a88d2" type="System.String">
          <orm:column name="ImageFileName" sql-type="varchar" nullable="false" length="255" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_imageOffset" property="ImageOffset" behavior="readwrite" uniqueId="1a9d93c6-99c0-49a2-af57-fed5949114c2" type="System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="ImageOffset" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_imageLength" property="ImageLength" behavior="readwrite" uniqueId="cae12ff6-a92c-4876-a38b-0fe829fc1155" type="System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="ImageLength" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_idImageType" property="IdImageType" behavior="readwrite" uniqueId="0d8267b7-77e2-4bac-8ff4-1853a46ad62f" type="System.Byte">
          <orm:column name="idImageType" sql-type="tinyint" nullable="false" length="0" scale="0" ado-type="Byte" />
        </orm:field>
        <orm:field name="_idImageSide" property="IdImageSide" behavior="readwrite" uniqueId="f73629dd-b69d-42e3-8ec1-69ac06dd39e9" type="System.Int32">
          <orm:column name="idImageSide" sql-type="int" nullable="false" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_noSignatureHashParam" property="NoSignatureHashParam" behavior="readwrite" uniqueId="1c505db8-4f45-4bee-98a3-6d625b215a44" type="System.Nullable`1[[System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="no_signature_hash_param" sql-type="uniqueidentifier" nullable="true" length="0" scale="0" ado-type="Guid" />
        </orm:field>
        <orm:field name="_signatureValue" property="SignatureValue" behavior="readwrite" uniqueId="a52d1e80-6bcb-4285-b3c3-2fe70afa340b" type="System.String">
          <orm:column name="SignatureValue" sql-type="varchar" nullable="true" length="512" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_isWhite" property="IsWhite" behavior="readwrite" uniqueId="506336c0-52d6-41d5-80c3-24749ccce953" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsWhite" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_isBlack" property="IsBlack" behavior="readwrite" uniqueId="87afe3d0-b834-4d06-92e3-7384bc6e0202" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsBlack" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_imageDotWidth" property="ImageDotWidth" behavior="readwrite" uniqueId="2ab959c2-0f16-4daf-b76c-acca424d17bc" type="System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="ImageDotWidth" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_imageDotHeight" property="ImageDotHeight" behavior="readwrite" uniqueId="5b026dfc-8bb1-4c15-81a9-d16f36e4ba2b" type="System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="ImageDotHeight" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_imagedotPerMillimeterX" property="ImagedotPerMillimeterX" behavior="readwrite" uniqueId="7f81eb09-ce86-4d9b-83f0-decffccbb0a2" type="System.Nullable`1[[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="ImagedotPerMillimeterX" sql-type="float" nullable="true" length="0" scale="0" ado-type="Double" />
        </orm:field>
        <orm:field name="_imagedotPerMillimeterY" property="ImagedotPerMillimeterY" behavior="readwrite" uniqueId="76e2b2bd-1b6d-43f9-8282-7474c3ddfcd5" type="System.Nullable`1[[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="ImagedotPerMillimeterY" sql-type="float" nullable="true" length="0" scale="0" ado-type="Double" />
        </orm:field>
        <orm:field name="_imageBitsPerPixel" property="ImageBitsPerPixel" behavior="readwrite" uniqueId="911ad349-2da8-4a22-86e1-2c758f74110f" type="System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="ImageBitsPerPixel" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_isSkewed" property="IsSkewed" behavior="readwrite" uniqueId="f91f8fac-73fa-4a04-8750-b902fe9e58f5" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsSkewed" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_isNoiseRemoved" property="IsNoiseRemoved" behavior="readwrite" uniqueId="e6eed533-2876-45d8-8181-a93945597d9d" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsNoiseRemoved" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_isBlackBlockRemoved" property="IsBlackBlockRemoved" behavior="readwrite" uniqueId="de21a825-051f-4c3d-a9b7-1887f9935aad" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsBlackBlockRemoved" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_isCharacterRepaired" property="IsCharacterRepaired" behavior="readwrite" uniqueId="a94eaa55-08d9-4636-9b88-2000c7661984" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsCharacterRepaired" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_isBinarized" property="IsBinarized" behavior="readwrite" uniqueId="5a2a496d-1eec-4367-a5ce-9e1e4cfd89e1" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsBinarized" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_isAutoOrientedPage" property="IsAutoOrientedPage" behavior="readwrite" uniqueId="609ba2e1-8222-4fc5-8cb7-f2b7b219a866" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsAutoOrientedPage" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_isAutoDeskewed" property="IsAutoDeskewed" behavior="readwrite" uniqueId="bd9afa41-1dfe-4d2a-aaa8-d0bf426366e2" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsAutoDeskewed" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_isRemovedBorder" property="IsRemovedBorder" behavior="readwrite" uniqueId="06d980a3-5491-4032-a042-cbbd39eca517" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsRemovedBorder" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_isMedianFiltered" property="IsMedianFiltered" behavior="readwrite" uniqueId="8b85ecd1-1e28-4db6-884e-e693839c819e" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsMedianFiltered" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_isDespeckled" property="IsDespeckled" behavior="readwrite" uniqueId="2f00d270-119f-4a1f-9aee-3bb56e85c10c" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="IsDespeckled" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_countMultiPage" property="CountMultiPage" behavior="readwrite" uniqueId="1c7deb05-dcc9-4609-a898-cdafb6f8ad2f" type="System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="CountMultiPage" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_angleRotate" property="AngleRotate" behavior="readwrite" uniqueId="088456f4-584b-482b-ac55-ac993108bd0c" type="System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="angleRotate" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_sourceId" property="SourceId" behavior="readwrite" uniqueId="e5e06908-52df-4ed1-9096-9f9d20849fbe" type="System.Nullable`1[[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="source_id" sql-type="bigint" nullable="true" length="0" scale="0" ado-type="Int64" />
        </orm:field>
        <orm:field name="_extensionCustom" property="ExtensionCustom" behavior="readwrite" uniqueId="a81f8fdc-5fd3-4eea-8dd6-798d1bbb55dd" type="System.String">
          <orm:column name="ExtensionCustom" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_pathUNC" property="PathUNC" behavior="readwrite" uniqueId="b05a4ecb-8752-40c3-bb7f-5e2170f87770" type="System.String">
          <orm:column name="pathUNC" sql-type="varchar" nullable="true" length="255" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_pathLocal" property="PathLocal" behavior="readwrite" uniqueId="63ae7178-3713-4820-92d7-0ad37ba3f437" type="System.String">
          <orm:column name="pathLocal" sql-type="varchar" nullable="true" length="255" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_extension" property="Extension" behavior="readwrite" uniqueId="06de880b-0e45-482c-9dad-4e950b88f91d" type="System.String">
          <orm:column name="extension" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_extensionWeb" property="ExtensionWeb" behavior="readwrite" uniqueId="6094a705-3676-4a42-b37e-3b8c7ebd04ee" type="System.String">
          <orm:column name="extensionWeb" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_extensionUnitType" property="ExtensionUnitType" behavior="readwrite" uniqueId="c1de2d04-10d4-43b6-a8a4-a5ea62ff7deb" type="System.String">
          <orm:column name="extensionUnitType" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_idImageColor" property="IdImageColor" behavior="readwrite" uniqueId="95a4c490-2c49-4017-8bb1-fcfedb68067b" type="System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="idImageColor" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_fieldIdentifier" property="FieldIdentifier" behavior="readwrite" uniqueId="a2458a33-9a16-4364-a680-6a0a5cb54ae5" type="System.Guid">
          <orm:column name="FieldIdentifier" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" ado-type="Guid" />
        </orm:field>
        <orm:field name="_cryptingKey" property="CryptingKey" behavior="readwrite" uniqueId="f75393dd-a227-4716-83f1-07a79fee4e04" type="System.String">
          <orm:column name="cryptingKey" sql-type="nvarchar(max)" nullable="true" length="0" scale="0" ado-type="UnicodeStringInfiniteLength" />
        </orm:field>
        <orm:field name="_bredDocumentEntity" property="BredDocumentEntity" behavior="readwrite" uniqueId="10686744-c82e-4c54-9629-f930021ff309" type="Bred.DataAccess.BredDocumentEntity">
          <orm:reference uniqueId="be96a399-0547-40fd-b41e-8705c202509d" association-name="BredDocumentImageEntityHasBredDocumentEntity">
            <orm:sharedfield name="_noDocument" target-class="Bred.DataAccess.BredDocumentEntity" target-field="_noDocument" />
            <orm:constraint name="FK_T_Bred_Document_Image_T_Bred_Document" delete-action="dbdefaultrule" destination-table="T_SPE_Bred_Document" />
          </orm:reference>
        </orm:field>
        <orm:index name="idx_T_SPE_Brd_Dcmnt_Img_n_dcmn">
          <orm:columnMapping>
            <orm:column name="no_document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
          </orm:columnMapping>
        </orm:index>
      </orm:class>
      <orm:class name="BredDocumentEntity" uniqueId="f7f3707c-2d32-49c4-99f3-eb5af0e0cda4">
        <orm:table name="T_SPE_Bred_Document" />
        <orm:identity>
          <orm:single-field field-name="_noDocument" />
        </orm:identity>
        <orm:concurrency strategy="changed" />
        <orm:field name="_noDocument" property="NoDocument" behavior="readwrite" uniqueId="e851e784-c746-4763-964d-ac6093ef0e76" type="System.Int64">
          <orm:column name="no_Document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        </orm:field>
        <orm:field name="_noPacket" property="NoPacket" behavior="readwrite" uniqueId="c6b7646d-c54b-490a-a35e-d19274903466" type="System.Int64">
          <orm:column name="no_packet" sql-type="bigint" nullable="false" length="0" scale="0" ado-type="Int64" />
        </orm:field>
        <orm:field name="_type" property="Type" behavior="readwrite" uniqueId="421e9817-33cb-4375-b9d2-6b91723be158" type="System.String">
          <orm:column name="type" sql-type="varchar" nullable="false" length="255" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_sequenceNumberCapture" property="SequenceNumberCapture" behavior="readwrite" uniqueId="0b25240e-063b-4135-84d8-133f1936b81d" type="System.Int32">
          <orm:column name="sequence_number_capture" sql-type="int" nullable="false" length="0" scale="0" ado-type="Int32" />
        </orm:field>
        <orm:field name="_bredPacketEntity" property="BredPacketEntity" behavior="readwrite" uniqueId="26fbb0e3-504d-4861-acf8-79c042ee16d5" type="Bred.DataAccess.BredPacketEntity">
          <orm:reference uniqueId="f892df1e-925c-4748-ad02-ccb5aa00fca0" association-name="BredDocumentEntityHasBredPacketEntity">
            <orm:sharedfield name="_noPacket" target-class="Bred.DataAccess.BredPacketEntity" target-field="_noPacket" />
            <orm:constraint name="FK_T_Bred_Document_T_Bred_Packet" delete-action="dbdefaultrule" destination-table="T_SPE_Bred_Packet" />
          </orm:reference>
        </orm:field>
        <orm:field name="_bredDocumentImageEntities" property="BredDocumentImageEntities" behavior="readwrite" uniqueId="3b9f8a9a-58b6-409b-8dfe-039cf8ec008f" type="Bred.DataAccess.BredDocumentImageEntity">
          <orm:collection element-class="Bred.DataAccess.BredDocumentImageEntity" inverse-field="_bredDocumentEntity" order-by="" uniqueId="be96a399-0547-40fd-b41e-8705c202509d" />
        </orm:field>
        <orm:field name="_bredDocumentMetadataEntities" property="BredDocumentMetadataEntities" behavior="readwrite" uniqueId="fcdbdf43-ec20-4676-8c0d-3178ac0e713f" type="Bred.DataAccess.BredDocumentMetadataEntity">
          <orm:collection element-class="Bred.DataAccess.BredDocumentMetadataEntity" inverse-field="_bredDocumentEntity" order-by="" uniqueId="9c62d97a-192d-4714-ade0-91991573fe85" />
        </orm:field>
        <orm:index name="idx_T_SPE_Brd_Dcment_no_packet">
          <orm:columnMapping>
            <orm:column name="no_packet" sql-type="bigint" nullable="false" length="0" scale="0" ado-type="Int64" />
          </orm:columnMapping>
        </orm:index>
      </orm:class>
      <orm:class name="ParamDocumentFieldEntity" uniqueId="030c2c73-d932-4714-abe7-4e76ac46395b">
        <orm:table name="ParamDocumentField" />
        <orm:identity>
          <orm:multiple-field>
            <orm:single-field field-name="_order" />
            <orm:single-field field-name="_documentTechnicalName" />
          </orm:multiple-field>
        </orm:identity>
        <orm:concurrency strategy="changed" />
        <orm:field name="_order" property="Order" behavior="readwrite" uniqueId="a29c8de9-2642-4f41-8708-2fe465e06a2a" type="System.Int32">
          <orm:column name="Order" sql-type="int" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int32" />
        </orm:field>
        <orm:field name="_displayName" property="DisplayName" behavior="readwrite" uniqueId="b19dfcfe-56bd-4621-8be7-b5f9af523d44" type="System.String">
          <orm:column name="DisplayName" sql-type="varchar" nullable="true" length="100" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_mandatory" property="Mandatory" behavior="readwrite" uniqueId="ff0c0b24-e1a2-466f-a533-86eb22e76b36" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="Mandatory" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_enabled" property="Enabled" behavior="readwrite" uniqueId="894759ce-551c-4acd-aa40-e148641275a4" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="Enabled" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_readOnly" property="ReadOnly" behavior="readwrite" uniqueId="d7f4e14f-e8e1-4e99-a2fc-77c188852048" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]">
          <orm:column name="ReadOnly" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        </orm:field>
        <orm:field name="_technicalName" property="TechnicalName" behavior="readwrite" uniqueId="fce22ac5-f741-4961-9247-e88e090e115c" type="System.String">
          <orm:column name="TechnicalName" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_name" property="Name" behavior="readwrite" uniqueId="25912c26-fa54-483b-a76d-1aa219c45a54" type="System.String">
          <orm:column name="Name" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_documentTechnicalName" property="DocumentTechnicalName" behavior="readwrite" uniqueId="629d0911-9e7a-4606-879b-0fd997be65fa" type="System.String">
          <orm:column name="Document_TechnicalName" sql-type="varchar" nullable="false" length="50" scale="0" primary-key="true" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_ParamDocumentEntity" property="ParamDocumentEntity" behavior="readwrite" uniqueId="457dc4b7-934d-4881-b6aa-5b62fb78e527" type="Bred.DataAccess.ParamDocumentEntity">
          <orm:reference uniqueId="d7f63736-2092-4f25-aa92-1c29a0baaa56" association-name="ParamDocumentFieldEntityHasParamDocumentEntity">
            <orm:sharedfield name="_documentTechnicalName" target-class="Bred.DataAccess.ParamDocumentEntity" target-field="_technicalName" />
            <orm:constraint name="FK_ParamDocumentField_ParamDocument" delete-action="dbdefaultrule" destination-table="ParamDocument" />
          </orm:reference>
        </orm:field>
      </orm:class>
      <orm:class name="ParamDocumentEntity" uniqueId="b5fbbbaa-5d48-4bbd-afe5-4c0047997ab5">
        <orm:table name="ParamDocument" />
        <orm:identity>
          <orm:single-field field-name="_technicalName" />
        </orm:identity>
        <orm:concurrency strategy="changed" />
        <orm:field name="_displayName" property="DisplayName" behavior="readwrite" uniqueId="3dc02a36-48fd-4947-87c4-5105ececaed8" type="System.String">
          <orm:column name="DisplayName" sql-type="varchar" nullable="true" length="100" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_technicalName" property="TechnicalName" behavior="readwrite" uniqueId="4253786b-5d6e-4a58-9b9e-f93e6875510f" type="System.String">
          <orm:column name="TechnicalName" sql-type="varchar" nullable="false" length="50" scale="0" primary-key="true" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_name" property="Name" behavior="readwrite" uniqueId="2b8563bd-5ed1-4c1a-9439-2672b57a2df4" type="System.String">
          <orm:column name="Name" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        </orm:field>
        <orm:field name="_ParamDocumentFieldEntities" property="ParamDocumentFieldEntities" behavior="readwrite" uniqueId="7fc7c729-faaa-406d-89fd-4b0aa6b54b96" type="Bred.DataAccess.ParamDocumentFieldEntity">
          <orm:collection element-class="Bred.DataAccess.ParamDocumentFieldEntity" inverse-field="_ParamDocumentEntity" order-by="" uniqueId="d7f63736-2092-4f25-aa92-1c29a0baaa56" />
        </orm:field>
      </orm:class>
    </orm:namespace>
    <orm:schema schema="">
      <orm:table name="T_SPE_Bred_Packet">
        <orm:column name="no_Packet" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        <orm:column name="Code_Batch" sql-type="varchar" nullable="false" length="50" scale="0" ado-type="StringVariableLength" />
        <orm:column name="dateReceive" sql-type="datetime" nullable="false" length="0" scale="0" ado-type="DateTime" />
        <orm:column name="dateCapture" sql-type="datetime" nullable="false" length="0" scale="0" ado-type="DateTime" />
        <orm:column name="dateEndTreatment" sql-type="datetime" nullable="true" length="0" scale="0" ado-type="DateTime" />
      </orm:table>
      <orm:table name="T_SPE_Bred_Document_Metadata">
        <orm:column name="no_document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        <orm:column name="no_field" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        <orm:column name="name" sql-type="varchar" nullable="false" length="200" scale="0" ado-type="StringVariableLength" />
        <orm:column name="value" sql-type="varchar" nullable="false" length="777" scale="0" ado-type="StringVariableLength" />
        <orm:index name="idx_T_SPE_Brd_Dcmnt_Mtdt_n_dcm">
          <orm:columnMapping>
            <orm:column name="no_document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
          </orm:columnMapping>
        </orm:index>
        <orm:constraint name="FK_T_Bred_Document_Metadata_T_Bred_Document" delete-action="dbdefaultrule" destination-table="T_SPE_Bred_Document">
          <orm:column name="no_document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        </orm:constraint>
      </orm:table>
      <orm:table name="T_SPE_Bred_Document_Image">
        <orm:column name="no_document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        <orm:column name="no_image" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        <orm:column name="no_field_meta" sql-type="int" nullable="false" length="0" scale="0" ado-type="Int32" />
        <orm:column name="idDisk" sql-type="int" nullable="false" length="0" scale="0" ado-type="Int32" />
        <orm:column name="Imagepath" sql-type="varchar" nullable="false" length="2000" scale="0" ado-type="StringVariableLength" />
        <orm:column name="ImageFileName" sql-type="varchar" nullable="false" length="255" scale="0" ado-type="StringVariableLength" />
        <orm:column name="ImageOffset" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        <orm:column name="ImageLength" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        <orm:column name="idImageType" sql-type="tinyint" nullable="false" length="0" scale="0" ado-type="Byte" />
        <orm:column name="idImageSide" sql-type="int" nullable="false" length="0" scale="0" ado-type="Int32" />
        <orm:column name="no_signature_hash_param" sql-type="uniqueidentifier" nullable="true" length="0" scale="0" ado-type="Guid" />
        <orm:column name="SignatureValue" sql-type="varchar" nullable="true" length="512" scale="0" ado-type="StringVariableLength" />
        <orm:column name="IsWhite" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="IsBlack" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="ImageDotWidth" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        <orm:column name="ImageDotHeight" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        <orm:column name="ImagedotPerMillimeterX" sql-type="float" nullable="true" length="0" scale="0" ado-type="Double" />
        <orm:column name="ImagedotPerMillimeterY" sql-type="float" nullable="true" length="0" scale="0" ado-type="Double" />
        <orm:column name="ImageBitsPerPixel" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        <orm:column name="IsSkewed" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="IsNoiseRemoved" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="IsBlackBlockRemoved" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="IsCharacterRepaired" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="IsBinarized" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="IsAutoOrientedPage" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="IsAutoDeskewed" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="IsRemovedBorder" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="IsMedianFiltered" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="IsDespeckled" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="CountMultiPage" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        <orm:column name="angleRotate" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        <orm:column name="source_id" sql-type="bigint" nullable="true" length="0" scale="0" ado-type="Int64" />
        <orm:column name="ExtensionCustom" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        <orm:column name="pathUNC" sql-type="varchar" nullable="true" length="255" scale="0" ado-type="StringVariableLength" />
        <orm:column name="pathLocal" sql-type="varchar" nullable="true" length="255" scale="0" ado-type="StringVariableLength" />
        <orm:column name="extension" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        <orm:column name="extensionWeb" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        <orm:column name="extensionUnitType" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        <orm:column name="idImageColor" sql-type="int" nullable="true" length="0" scale="0" ado-type="Int32" />
        <orm:column name="FieldIdentifier" sql-type="uniqueidentifier" nullable="false" length="0" scale="0" ado-type="Guid" />
        <orm:column name="cryptingKey" sql-type="nvarchar(max)" nullable="true" length="0" scale="0" ado-type="UnicodeStringInfiniteLength" />
        <orm:index name="idx_T_SPE_Brd_Dcmnt_Img_n_dcmn">
          <orm:columnMapping>
            <orm:column name="no_document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
          </orm:columnMapping>
        </orm:index>
        <orm:constraint name="FK_T_Bred_Document_Image_T_Bred_Document" delete-action="dbdefaultrule" destination-table="T_SPE_Bred_Document">
          <orm:column name="no_document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        </orm:constraint>
      </orm:table>
      <orm:table name="T_SPE_Bred_Document">
        <orm:column name="no_Document" sql-type="bigint" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int64" />
        <orm:column name="no_packet" sql-type="bigint" nullable="false" length="0" scale="0" ado-type="Int64" />
        <orm:column name="type" sql-type="varchar" nullable="false" length="255" scale="0" ado-type="StringVariableLength" />
        <orm:column name="sequence_number_capture" sql-type="int" nullable="false" length="0" scale="0" ado-type="Int32" />
        <orm:index name="idx_T_SPE_Brd_Dcment_no_packet">
          <orm:columnMapping>
            <orm:column name="no_packet" sql-type="bigint" nullable="false" length="0" scale="0" ado-type="Int64" />
          </orm:columnMapping>
        </orm:index>
        <orm:constraint name="FK_T_Bred_Document_T_Bred_Packet" delete-action="dbdefaultrule" destination-table="T_SPE_Bred_Packet">
          <orm:column name="no_packet" sql-type="bigint" nullable="false" length="0" scale="0" ado-type="Int64" />
        </orm:constraint>
      </orm:table>
      <orm:table name="ParamDocumentField">
        <orm:column name="Order" sql-type="int" nullable="false" length="0" scale="0" primary-key="true" ado-type="Int32" />
        <orm:column name="DisplayName" sql-type="varchar" nullable="true" length="100" scale="0" ado-type="StringVariableLength" />
        <orm:column name="Mandatory" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="Enabled" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="ReadOnly" sql-type="bit" nullable="true" length="0" scale="0" ado-type="Bit" />
        <orm:column name="TechnicalName" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        <orm:column name="Name" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
        <orm:column name="Document_TechnicalName" sql-type="varchar" nullable="false" length="50" scale="0" primary-key="true" ado-type="StringVariableLength" />
        <orm:constraint name="FK_ParamDocumentField_ParamDocument" delete-action="dbdefaultrule" destination-table="ParamDocument">
          <orm:column name="Document_TechnicalName" sql-type="varchar" nullable="false" length="50" scale="0" primary-key="true" ado-type="StringVariableLength" />
        </orm:constraint>
      </orm:table>
      <orm:table name="ParamDocument">
        <orm:column name="DisplayName" sql-type="varchar" nullable="true" length="100" scale="0" ado-type="StringVariableLength" />
        <orm:column name="TechnicalName" sql-type="varchar" nullable="false" length="50" scale="0" primary-key="true" ado-type="StringVariableLength" />
        <orm:column name="Name" sql-type="varchar" nullable="true" length="50" scale="0" ado-type="StringVariableLength" />
      </orm:table>
    </orm:schema>
    <orm:relational-naming-settings>
      <orm:source-strategy>Property</orm:source-strategy>
      <orm:remove-camel-case>False</orm:remove-camel-case>
    </orm:relational-naming-settings>
  </orm:orm>
  <ModelSettings xmlns="">
    <AppConfigConnectionPropertyName>CatalogueConnectionString</AppConfigConnectionPropertyName>
    <AppConfigConnectionString>data source=srvas1172v6;initial catalog=Catalogue;persist security info=True;user id=sa;password=@thicsql10</AppConfigConnectionString>
    <InitialCatalog>Catalogue</InitialCatalog>
    <NamingSettings>
      <ClassRules>
        <AddSuffix>Entity</AddSuffix>
        <RemovePrefix>T_</RemovePrefix>
        <CaseMode>PascalCase</CaseMode>
        <PluralizationMode>Singularize</PluralizationMode>
        <RemoveUnderscore>true</RemoveUnderscore>
        <UnderscoreAsWordDelimiter>true</UnderscoreAsWordDelimiter>
        <CapitalLetterAsWordDelimiter>false</CapitalLetterAsWordDelimiter>
      </ClassRules>
      <FieldRules>
        <AddPrefix>_</AddPrefix>
        <CaseMode>CamelCase</CaseMode>
        <RemoveUnderscore>true</RemoveUnderscore>
        <UnderscoreAsWordDelimiter>true</UnderscoreAsWordDelimiter>
      </FieldRules>
      <PropertyRules>
        <CaseMode>PascalCase</CaseMode>
        <RemoveUnderscore>true</RemoveUnderscore>
        <UnderscoreAsWordDelimiter>true</UnderscoreAsWordDelimiter>
      </PropertyRules>
      <NavigationPropertyRules>
        <IsPrefixSuffixEnabled>false</IsPrefixSuffixEnabled>
      </NavigationPropertyRules>
    </NamingSettings>
    <CodeGenerationSettings>
      <MappingDefinitionType>Xml</MappingDefinitionType>
      <GenerateMultipleFiles>false</GenerateMultipleFiles>
    </CodeGenerationSettings>
    <SchemaUpdateSettings />
    <BackendConfigurationSettings>
      <BackendConfiguration>
        <Backend>MsSql</Backend>
        <ProviderName>System.Data.SqlClient</ProviderName>
      </BackendConfiguration>
    </BackendConfigurationSettings>
  </ModelSettings>
  <Types>
    <DomainClass Id="338149a9-9830-4d0c-a05e-3cc4139c657d" name="BredPacketEntity" namespace="Bred.DataAccess" showPropertiesCompartment="true" concurrencyMode="Changed" showNavigationCompartment="true" showImplementationCompartment="true">
      <Property Id="5ad7e165-e942-4a6a-8e72-06e9b9e874de" name="NoPacket" type="Int64" label="NoPacket : Int64" kind="Persistent" identity="true" fieldName="_noPacket" />
      <Property Id="7c3e1637-dc8c-4b0a-b301-036f8c92d8c7" name="CodeBatch" label="CodeBatch : String" kind="Persistent" fieldName="_codeBatch" />
      <Property Id="1fa15951-ffb7-435f-bbf9-093dc9b3e90f" name="DteCapture" type="DateTime" label="DteCapture : DateTime" kind="Persistent" fieldName="_dteCapture" />
      <Property Id="3dcd7d6e-95a4-44d0-add6-3bbbfc17a430" name="DteReceive" type="DateTime" label="DteReceive : DateTime" kind="Persistent" fieldName="_dteReceive" />
      <Property Id="d626b880-6159-4ffc-a982-2011d20d80ee" name="DteEndTreatment" type="DateTime" label="DteEndTreatment : DateTime" nullable="true" kind="Persistent" fieldName="_dteEndTreatment" />
      <navigationalProperties>
        <classHasNavigationalProperties Id="9625da25-faa4-4471-91b4-903858433eea">
          <NavigationalProperty Id="315aaf56-f555-4ea8-9e3c-84ab5cde72f5" name="BredDocumentEntities" type="IList<BredDocumentEntity>" label="BredDocumentEntities : IList<BredDocumentEntity>" nullable="true" kind="Persistent" fieldName="_bredDocumentEntities" isDependent="false" isManaged="false" />
        </classHasNavigationalProperties>
      </navigationalProperties>
    </DomainClass>
    <DomainClass Id="d1de7556-8e05-4428-b8ea-fbcf645a8efc" name="BredDocumentMetadataEntity" namespace="Bred.DataAccess" showPropertiesCompartment="true" concurrencyMode="Changed" showNavigationCompartment="true" showImplementationCompartment="true">
      <Property Id="002f2501-d00a-437f-8e90-9a55390d93ee" name="NoDocument" type="Int64" label="NoDocument : Int64" kind="Persistent" identity="true" fieldName="_noDocument" />
      <Property Id="373b498d-3a04-47d7-aae6-8cb459893ba5" name="NoField" type="Int64" label="NoField : Int64" kind="Persistent" identity="true" fieldName="_noField" />
      <Property Id="5b59dab9-9679-46fc-8abd-f79a9d521675" name="Name" label="Name : String" kind="Persistent" fieldName="_name" />
      <Property Id="0d289f80-21ac-4bdf-8cd6-6486f74fb00c" name="Value" label="Value : String" kind="Persistent" fieldName="_value" />
      <AssociationTargets>
        <Association Id="9c62d97a-192d-4714-ade0-91991573fe85" SourceMultiplicity="One" name="BredDocumentMetadataEntityHasBredDocumentEntity">
          <DomainClassMoniker name="/EntitiesModel/BredDocumentEntity" />
          <targetNavigationalProperty>
            <associationDefinesTargetProperty Id="d7ef4252-ae05-481c-9fe5-1ab4a923b490">
              <NavigationalPropertyMoniker name="/EntitiesModel/BredDocumentEntity/BredDocumentMetadataEntities" />
            </associationDefinesTargetProperty>
          </targetNavigationalProperty>
          <sourceNavigationalProperty>
            <associationDefinesSourceProperty Id="c5f8a757-16de-49d2-bb41-8f64373f363d">
              <NavigationalPropertyMoniker name="/EntitiesModel/BredDocumentMetadataEntity/BredDocumentEntity" />
            </associationDefinesSourceProperty>
          </sourceNavigationalProperty>
        </Association>
      </AssociationTargets>
      <navigationalProperties>
        <classHasNavigationalProperties Id="4673da81-ca4f-42ca-817d-b7d89dd6806d">
          <NavigationalProperty Id="d6a2c3c6-4ca2-49f5-b81f-c7047a013f19" name="BredDocumentEntity" type="BredDocumentEntity" label="BredDocumentEntity : BredDocumentEntity" nullable="true" kind="Persistent" fieldName="_bredDocumentEntity" isDependent="false" isManaged="false" />
        </classHasNavigationalProperties>
      </navigationalProperties>
    </DomainClass>
    <DomainClass Id="36558e49-4f01-4e6d-8635-23db01d755ce" name="BredDocumentImageEntity" namespace="Bred.DataAccess" showPropertiesCompartment="true" concurrencyMode="Changed" showNavigationCompartment="true" showImplementationCompartment="true">
      <Property Id="dc669f1d-c006-4591-b550-4b5a0053fcb4" name="NoDocument" type="Int64" label="NoDocument : Int64" kind="Persistent" identity="true" fieldName="_noDocument" />
      <Property Id="241af854-af6f-4c30-b681-b7578e0468e7" name="NoImage" type="Int64" label="NoImage : Int64" kind="Persistent" identity="true" fieldName="_noImage" />
      <Property Id="088456f4-584b-482b-ac55-ac993108bd0c" name="AngleRotate" type="Int32" label="AngleRotate : Int32" nullable="true" kind="Persistent" fieldName="_angleRotate" />
      <Property Id="1c7deb05-dcc9-4609-a898-cdafb6f8ad2f" name="CountMultiPage" type="Int32" label="CountMultiPage : Int32" nullable="true" kind="Persistent" fieldName="_countMultiPage" />
      <Property Id="06de880b-0e45-482c-9dad-4e950b88f91d" name="Extension" label="Extension : String" kind="Persistent" fieldName="_extension" />
      <Property Id="a81f8fdc-5fd3-4eea-8dd6-798d1bbb55dd" name="ExtensionCustom" label="ExtensionCustom : String" kind="Persistent" fieldName="_extensionCustom" />
      <Property Id="c1de2d04-10d4-43b6-a8a4-a5ea62ff7deb" name="ExtensionUnitType" label="ExtensionUnitType : String" kind="Persistent" fieldName="_extensionUnitType" />
      <Property Id="6094a705-3676-4a42-b37e-3b8c7ebd04ee" name="ExtensionWeb" label="ExtensionWeb : String" kind="Persistent" fieldName="_extensionWeb" />
      <Property Id="2cb5d96f-e8a9-4fd9-a53a-8a3b81093f5b" name="IdDisk" type="Int32" label="IdDisk : Int32" kind="Persistent" fieldName="_idDisk" />
      <Property Id="95a4c490-2c49-4017-8bb1-fcfedb68067b" name="IdImageColor" type="Int32" label="IdImageColor : Int32" nullable="true" kind="Persistent" fieldName="_idImageColor" />
      <Property Id="f73629dd-b69d-42e3-8ec1-69ac06dd39e9" name="IdImageSide" type="Int32" label="IdImageSide : Int32" kind="Persistent" fieldName="_idImageSide" />
      <Property Id="0d8267b7-77e2-4bac-8ff4-1853a46ad62f" name="IdImageType" type="Byte" label="IdImageType : Byte" kind="Persistent" fieldName="_idImageType" />
      <Property Id="911ad349-2da8-4a22-86e1-2c758f74110f" name="ImageBitsPerPixel" type="Int32" label="ImageBitsPerPixel : Int32" nullable="true" kind="Persistent" fieldName="_imageBitsPerPixel" />
      <Property Id="5b026dfc-8bb1-4c15-81a9-d16f36e4ba2b" name="ImageDotHeight" type="Int32" label="ImageDotHeight : Int32" nullable="true" kind="Persistent" fieldName="_imageDotHeight" />
      <Property Id="7f81eb09-ce86-4d9b-83f0-decffccbb0a2" name="ImagedotPerMillimeterX" type="Double" label="ImagedotPerMillimeterX : Double" nullable="true" kind="Persistent" fieldName="_imagedotPerMillimeterX" />
      <Property Id="76e2b2bd-1b6d-43f9-8282-7474c3ddfcd5" name="ImagedotPerMillimeterY" type="Double" label="ImagedotPerMillimeterY : Double" nullable="true" kind="Persistent" fieldName="_imagedotPerMillimeterY" />
      <Property Id="2ab959c2-0f16-4daf-b76c-acca424d17bc" name="ImageDotWidth" type="Int32" label="ImageDotWidth : Int32" nullable="true" kind="Persistent" fieldName="_imageDotWidth" />
      <Property Id="08b97f8d-fd5e-4671-a5cc-2942542a88d2" name="ImageFileName" label="ImageFileName : String" kind="Persistent" fieldName="_imageFileName" />
      <Property Id="cae12ff6-a92c-4876-a38b-0fe829fc1155" name="ImageLength" type="Int32" label="ImageLength : Int32" nullable="true" kind="Persistent" fieldName="_imageLength" />
      <Property Id="1a9d93c6-99c0-49a2-af57-fed5949114c2" name="ImageOffset" type="Int32" label="ImageOffset : Int32" nullable="true" kind="Persistent" fieldName="_imageOffset" />
      <Property Id="ae2bf6db-040a-439b-b277-c13202ebbe79" name="Imagepath" label="Imagepath : String" kind="Persistent" fieldName="_imagepath" />
      <Property Id="bd9afa41-1dfe-4d2a-aaa8-d0bf426366e2" name="IsAutoDeskewed" type="Boolean" label="IsAutoDeskewed : Boolean" nullable="true" kind="Persistent" fieldName="_isAutoDeskewed" />
      <Property Id="609ba2e1-8222-4fc5-8cb7-f2b7b219a866" name="IsAutoOrientedPage" type="Boolean" label="IsAutoOrientedPage : Boolean" nullable="true" kind="Persistent" fieldName="_isAutoOrientedPage" />
      <Property Id="5a2a496d-1eec-4367-a5ce-9e1e4cfd89e1" name="IsBinarized" type="Boolean" label="IsBinarized : Boolean" nullable="true" kind="Persistent" fieldName="_isBinarized" />
      <Property Id="87afe3d0-b834-4d06-92e3-7384bc6e0202" name="IsBlack" type="Boolean" label="IsBlack : Boolean" nullable="true" kind="Persistent" fieldName="_isBlack" />
      <Property Id="de21a825-051f-4c3d-a9b7-1887f9935aad" name="IsBlackBlockRemoved" type="Boolean" label="IsBlackBlockRemoved : Boolean" nullable="true" kind="Persistent" fieldName="_isBlackBlockRemoved" />
      <Property Id="a94eaa55-08d9-4636-9b88-2000c7661984" name="IsCharacterRepaired" type="Boolean" label="IsCharacterRepaired : Boolean" nullable="true" kind="Persistent" fieldName="_isCharacterRepaired" />
      <Property Id="2f00d270-119f-4a1f-9aee-3bb56e85c10c" name="IsDespeckled" type="Boolean" label="IsDespeckled : Boolean" nullable="true" kind="Persistent" fieldName="_isDespeckled" />
      <Property Id="8b85ecd1-1e28-4db6-884e-e693839c819e" name="IsMedianFiltered" type="Boolean" label="IsMedianFiltered : Boolean" nullable="true" kind="Persistent" fieldName="_isMedianFiltered" />
      <Property Id="e6eed533-2876-45d8-8181-a93945597d9d" name="IsNoiseRemoved" type="Boolean" label="IsNoiseRemoved : Boolean" nullable="true" kind="Persistent" fieldName="_isNoiseRemoved" />
      <Property Id="06d980a3-5491-4032-a042-cbbd39eca517" name="IsRemovedBorder" type="Boolean" label="IsRemovedBorder : Boolean" nullable="true" kind="Persistent" fieldName="_isRemovedBorder" />
      <Property Id="f91f8fac-73fa-4a04-8750-b902fe9e58f5" name="IsSkewed" type="Boolean" label="IsSkewed : Boolean" nullable="true" kind="Persistent" fieldName="_isSkewed" />
      <Property Id="506336c0-52d6-41d5-80c3-24749ccce953" name="IsWhite" type="Boolean" label="IsWhite : Boolean" nullable="true" kind="Persistent" fieldName="_isWhite" />
      <Property Id="35f61519-824d-4a14-a705-73a2962fcdb0" name="NoFieldMeta" type="Int32" label="NoFieldMeta : Int32" kind="Persistent" fieldName="_noFieldMeta" />
      <Property Id="1c505db8-4f45-4bee-98a3-6d625b215a44" name="NoSignatureHashParam" type="Guid" label="NoSignatureHashParam : Guid" nullable="true" kind="Persistent" fieldName="_noSignatureHashParam" />
      <Property Id="63ae7178-3713-4820-92d7-0ad37ba3f437" name="PathLocal" label="PathLocal : String" kind="Persistent" fieldName="_pathLocal" />
      <Property Id="b05a4ecb-8752-40c3-bb7f-5e2170f87770" name="PathUNC" label="PathUNC : String" kind="Persistent" fieldName="_pathUNC" />
      <Property Id="a52d1e80-6bcb-4285-b3c3-2fe70afa340b" name="SignatureValue" label="SignatureValue : String" kind="Persistent" fieldName="_signatureValue" />
      <Property Id="e5e06908-52df-4ed1-9096-9f9d20849fbe" name="SourceId" type="Int64" label="SourceId : Int64" nullable="true" kind="Persistent" fieldName="_sourceId" />
      <Property Id="a2458a33-9a16-4364-a680-6a0a5cb54ae5" name="FieldIdentifier" type="Guid" label="FieldIdentifier : Guid" kind="Persistent" fieldName="_fieldIdentifier" />
      <Property Id="f75393dd-a227-4716-83f1-07a79fee4e04" name="CryptingKey" label="CryptingKey : String" kind="Persistent" fieldName="_cryptingKey" />
      <AssociationTargets>
        <Association Id="be96a399-0547-40fd-b41e-8705c202509d" SourceMultiplicity="One" name="BredDocumentImageEntityHasBredDocumentEntity">
          <DomainClassMoniker name="/EntitiesModel/BredDocumentEntity" />
          <targetNavigationalProperty>
            <associationDefinesTargetProperty Id="99ff5006-5db3-4ebe-819e-196963da4e56">
              <NavigationalPropertyMoniker name="/EntitiesModel/BredDocumentEntity/BredDocumentImageEntities" />
            </associationDefinesTargetProperty>
          </targetNavigationalProperty>
          <sourceNavigationalProperty>
            <associationDefinesSourceProperty Id="bc85300d-6f8e-4451-b5c3-88801ec55c96">
              <NavigationalPropertyMoniker name="/EntitiesModel/BredDocumentImageEntity/BredDocumentEntity" />
            </associationDefinesSourceProperty>
          </sourceNavigationalProperty>
        </Association>
      </AssociationTargets>
      <navigationalProperties>
        <classHasNavigationalProperties Id="697dab77-fc6e-4e83-98dc-a074638acf5d">
          <NavigationalProperty Id="10686744-c82e-4c54-9629-f930021ff309" name="BredDocumentEntity" type="BredDocumentEntity" label="BredDocumentEntity : BredDocumentEntity" nullable="true" kind="Persistent" fieldName="_bredDocumentEntity" isDependent="false" isManaged="false" />
        </classHasNavigationalProperties>
      </navigationalProperties>
    </DomainClass>
    <DomainClass Id="f7f3707c-2d32-49c4-99f3-eb5af0e0cda4" name="BredDocumentEntity" namespace="Bred.DataAccess" showPropertiesCompartment="true" concurrencyMode="Changed" showNavigationCompartment="true" showImplementationCompartment="true">
      <Property Id="e851e784-c746-4763-964d-ac6093ef0e76" name="NoDocument" type="Int64" label="NoDocument : Int64" kind="Persistent" identity="true" fieldName="_noDocument" />
      <Property Id="c6b7646d-c54b-490a-a35e-d19274903466" name="NoPacket" type="Int64" label="NoPacket : Int64" kind="Persistent" fieldName="_noPacket" />
      <Property Id="0b25240e-063b-4135-84d8-133f1936b81d" name="SequenceNumberCapture" type="Int32" label="SequenceNumberCapture : Int32" kind="Persistent" fieldName="_sequenceNumberCapture" />
      <Property Id="421e9817-33cb-4375-b9d2-6b91723be158" name="Type" label="Type : String" kind="Persistent" fieldName="_type" />
      <AssociationTargets>
        <Association Id="f892df1e-925c-4748-ad02-ccb5aa00fca0" SourceMultiplicity="One" name="BredDocumentEntityHasBredPacketEntity">
          <DomainClassMoniker name="/EntitiesModel/BredPacketEntity" />
          <targetNavigationalProperty>
            <associationDefinesTargetProperty Id="03f867f7-fdcc-4cd4-8928-090b3ada1871">
              <NavigationalPropertyMoniker name="/EntitiesModel/BredPacketEntity/BredDocumentEntities" />
            </associationDefinesTargetProperty>
          </targetNavigationalProperty>
          <sourceNavigationalProperty>
            <associationDefinesSourceProperty Id="1dd9226f-085f-49fd-86c2-e273b49022bb">
              <NavigationalPropertyMoniker name="/EntitiesModel/BredDocumentEntity/BredPacketEntity" />
            </associationDefinesSourceProperty>
          </sourceNavigationalProperty>
        </Association>
      </AssociationTargets>
      <navigationalProperties>
        <classHasNavigationalProperties Id="02fa9017-b0c3-4523-a922-6d4bf639a1a6">
          <NavigationalProperty Id="26fbb0e3-504d-4861-acf8-79c042ee16d5" name="BredPacketEntity" type="BredPacketEntity" label="BredPacketEntity : BredPacketEntity" nullable="true" kind="Persistent" fieldName="_bredPacketEntity" isDependent="false" isManaged="false" />
        </classHasNavigationalProperties>
        <classHasNavigationalProperties Id="7033719a-d6d0-43fd-9d38-4e59b84a1d6a">
          <NavigationalProperty Id="3b9f8a9a-58b6-409b-8dfe-039cf8ec008f" name="BredDocumentImageEntities" type="IList<BredDocumentImageEntity>" label="BredDocumentImageEntities : IList<BredDocumentImageEntity>" nullable="true" kind="Persistent" fieldName="_bredDocumentImageEntities" isDependent="false" isManaged="false" />
        </classHasNavigationalProperties>
        <classHasNavigationalProperties Id="07c95e8c-443b-43fe-ab64-861368ad162e">
          <NavigationalProperty Id="fcdbdf43-ec20-4676-8c0d-3178ac0e713f" name="BredDocumentMetadataEntities" type="IList<BredDocumentMetadataEntity>" label="BredDocumentMetadataEntities : IList<BredDocumentMetadataEntity>" nullable="true" kind="Persistent" fieldName="_bredDocumentMetadataEntities" isDependent="false" isManaged="false" />
        </classHasNavigationalProperties>
      </navigationalProperties>
    </DomainClass>
    <DomainClass Id="030c2c73-d932-4714-abe7-4e76ac46395b" name="ParamDocumentFieldEntity" namespace="Bred.DataAccess" showPropertiesCompartment="true" concurrencyMode="Changed" showNavigationCompartment="true" showImplementationCompartment="true">
      <Property Id="a29c8de9-2642-4f41-8708-2fe465e06a2a" name="Order" type="Int32" label="Order : Int32" kind="Persistent" identity="true" fieldName="_order" />
      <Property Id="b19dfcfe-56bd-4621-8be7-b5f9af523d44" name="DisplayName" label="DisplayName : String" kind="Persistent" fieldName="_displayName" />
      <Property Id="894759ce-551c-4acd-aa40-e148641275a4" name="Enabled" type="Boolean" label="Enabled : Boolean" nullable="true" kind="Persistent" fieldName="_enabled" />
      <Property Id="d7f4e14f-e8e1-4e99-a2fc-77c188852048" name="ReadOnly" type="Boolean" label="ReadOnly : Boolean" nullable="true" kind="Persistent" fieldName="_readOnly" />
      <Property Id="ff0c0b24-e1a2-466f-a533-86eb22e76b36" name="Mandatory" type="Boolean" label="Mandatory : Boolean" nullable="true" kind="Persistent" fieldName="_mandatory" />
      <Property Id="fce22ac5-f741-4961-9247-e88e090e115c" name="TechnicalName" label="TechnicalName : String" kind="Persistent" fieldName="_technicalName" />
      <Property Id="25912c26-fa54-483b-a76d-1aa219c45a54" name="Name" label="Name : String" kind="Persistent" fieldName="_name" />
      <Property Id="629d0911-9e7a-4606-879b-0fd997be65fa" name="DocumentTechnicalName" label="DocumentTechnicalName : String" kind="Persistent" identity="true" fieldName="_documentTechnicalName" />
      <AssociationTargets>
        <Association Id="d7f63736-2092-4f25-aa92-1c29a0baaa56" SourceMultiplicity="One" name="ParamDocumentFieldEntityHasParamDocumentEntity">
          <DomainClassMoniker name="/EntitiesModel/ParamDocumentEntity" />
          <targetNavigationalProperty>
            <associationDefinesTargetProperty Id="742f45ce-0e06-48e7-95c9-8badbee56fda">
              <NavigationalPropertyMoniker name="/EntitiesModel/ParamDocumentEntity/ParamDocumentFieldEntities" />
            </associationDefinesTargetProperty>
          </targetNavigationalProperty>
          <sourceNavigationalProperty>
            <associationDefinesSourceProperty Id="3b6d7dd1-1f70-42ac-9427-10163830e5e0">
              <NavigationalPropertyMoniker name="/EntitiesModel/ParamDocumentFieldEntity/ParamDocumentEntity" />
            </associationDefinesSourceProperty>
          </sourceNavigationalProperty>
        </Association>
      </AssociationTargets>
      <navigationalProperties>
        <classHasNavigationalProperties Id="e01e00b9-a0a8-4d65-ac8c-48837aca1d3b">
          <NavigationalProperty Id="457dc4b7-934d-4881-b6aa-5b62fb78e527" name="ParamDocumentEntity" type="ParamDocumentEntity" label="ParamDocumentEntity : ParamDocumentEntity" nullable="true" kind="Persistent" fieldName="_ParamDocumentEntity" isDependent="false" isManaged="false" />
        </classHasNavigationalProperties>
      </navigationalProperties>
    </DomainClass>
    <DomainClass Id="b5fbbbaa-5d48-4bbd-afe5-4c0047997ab5" name="ParamDocumentEntity" namespace="Bred.DataAccess" showPropertiesCompartment="true" concurrencyMode="Changed" showNavigationCompartment="true" showImplementationCompartment="true">
      <Property Id="3dc02a36-48fd-4947-87c4-5105ececaed8" name="DisplayName" label="DisplayName : String" kind="Persistent" fieldName="_displayName" />
      <Property Id="4253786b-5d6e-4a58-9b9e-f93e6875510f" name="TechnicalName" label="TechnicalName : String" kind="Persistent" identity="true" fieldName="_technicalName" />
      <Property Id="2b8563bd-5ed1-4c1a-9439-2672b57a2df4" name="Name" label="Name : String" kind="Persistent" fieldName="_name" />
      <navigationalProperties>
        <classHasNavigationalProperties Id="fec48445-82dd-446e-9bb5-77980778f9ca">
          <NavigationalProperty Id="7fc7c729-faaa-406d-89fd-4b0aa6b54b96" name="ParamDocumentFieldEntities" type="IList<ParamDocumentFieldEntity>" label="ParamDocumentFieldEntities : IList<ParamDocumentFieldEntity>" nullable="true" kind="Persistent" fieldName="_ParamDocumentFieldEntities" isDependent="false" isManaged="false" />
        </classHasNavigationalProperties>
      </navigationalProperties>
    </DomainClass>
  </Types>
  <domainContext>
    <domainModelHasDomainContext Id="28b8f19c-def4-4a60-bf21-96827313a656">
      <domainContainer name="EntitiesModel" namespace="Bred.DataAccess" showPropertiesCompartment="true">
        <entitySetProperty name="BredPacketEntities" namespace="Bred.DataAccess" type="BredPacketEntity" label="BredPacketEntities : IQueryable<Bred.DataAccess.BredPacketEntity>" />
        <entitySetProperty name="BredDocumentMetadataEntities" namespace="Bred.DataAccess" type="BredDocumentMetadataEntity" label="BredDocumentMetadataEntities : IQueryable<Bred.DataAccess.BredDocumentMetadataEntity>" />
        <entitySetProperty name="BredDocumentImageEntities" namespace="Bred.DataAccess" type="BredDocumentImageEntity" label="BredDocumentImageEntities : IQueryable<Bred.DataAccess.BredDocumentImageEntity>" />
        <entitySetProperty name="BredDocumentEntities" namespace="Bred.DataAccess" type="BredDocumentEntity" label="BredDocumentEntities : IQueryable<Bred.DataAccess.BredDocumentEntity>" />
        <entitySetProperty name="ParamDocumentFieldEntities" namespace="Bred.DataAccess" type="ParamDocumentFieldEntity" label="ParamDocumentFieldEntities : IQueryable<Bred.DataAccess.ParamDocumentFieldEntity>" />
        <entitySetProperty name="ParamDocumentEntities" namespace="Bred.DataAccess" type="ParamDocumentEntity" label="ParamDocumentEntities : IQueryable<Bred.DataAccess.ParamDocumentEntity>" />
      </domainContainer>
    </domainModelHasDomainContext>
  </domainContext>
</DomainModel>
0
Kristian Nikolov
Telerik team
answered on 04 Jul 2014, 08:01 AM
Hi Yannick,

Thank you for the provided details.

Using them we attempted to reproduce the error in the following scenarios:
  • Scenario 1 - we created the tables using the provided SQL script but instead of FieldTechnicalName we used TechnicalName (the original name) for the name of the respective column. We created a Domain Model from this database and queried the ParamDocumentFieldEntities property of a ParamDocumentEntity object.
  • Scenario 2 - we created the tables without the TechnicalName columns. Then we created a Domain Model from the database. We added the TechnicalName columns along with the relation between the tables and updated the Domain Model. To test the model again we queried the ParamDocumentFieldEntities property of a ParamDocumentEntity object.

In both cases the properties of the persistent classes and the columns of the tables in the Domain Model were named correctly and query executed successfully. While we did use a different LINQ query, it did result in a very similar SQL query being generated and executed:

SELECT b.[Document_TechnicalName] AS COL1, b.[Order] AS COL2, b.[DisplayName] AS COL3, b.[Enabled] AS COL4, b.[Mandatory] AS COL5, b.[Name] AS COL6, b.[Document_TechnicalName] AS COL7, b.[ReadOnly] AS COL8, b.[TechnicalName] AS COL9 FROM [ParamDocument] a LEFT JOIN [ParamDocumentField] AS b ON (a.[TechnicalName] = b.[Document_TechnicalName]) WHERE a.[TechnicalName] = @p0                                       

The only way we managed to reproduce the error is by renaming the Document_TechnicalName column in the Model Schema Explorer to TechnicalName2. However we are unable to reproduce a scenario where the column in the model would be automatically generated with such name using the given database tables.

On another note, we noticed that you use an object to object mapping tool in the query you have executed. Based on the API it appears that the tool would be AutoMapper. Could you please confirm whether this is the case and send us the code for the used DTO type used in the mapping? This would allow us to eliminate the differences between our test cases and your scenario by executing the very same query.

We are looking forward to your feedback.

​Regards,
Kristian Nikolov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
Yannick
Top achievements
Rank 1
answered on 04 Jul 2014, 02:35 PM
Hi;
Thx for the reply, and the time spent on this weird problem.
I certainly have done something wrong at a time, but really don't know what.
I can affirm that there were no string 'technialname2' in any of the files, and that I spent a time trying to find out why I got it :/
Anyway.

Here is the AutoMapper code stored in the svn log:
Mapper.CreateMap<ParamDocumentEntity, ParamDocument>()
    // useless, same names
    //.ForMember(dest => dest.TechnicalName, opt => opt.MapFrom(src => src.TechnicalName))
    //.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name))
    //.ForMember(dest => dest.DisplayName, opt => opt.MapFrom(src => src.DisplayName))
    .ForMember(dest => dest.Sorter, opt => opt.Ignore())
    .ForMember(dest => dest.Fields, opt => opt.MapFrom(src => src.ParamDocumentFieldEntities))
    .AfterMap((src, dest) =>
                {
                    dest.Fields.ForEach(df => df.Document = dest);
                    dest.SortFields();
                }
            )
    ;
 
Mapper.CreateMap<ParamDocumentFieldEntity, ParamDocumentField>()
    // useless, same names
    //.ForMember(dest => dest.Document, opt => opt.MapFrom(src => src.ParamDocumentEntity))
    .ForMember(dest => dest.Document, opt => opt.Ignore())
    //.ForMember(dest => dest.Order, opt => opt.MapFrom(src => src.Order))
    //.ForMember(dest => dest.TechnicalName, opt => opt.MapFrom(src => src.TechnicalName))
    //.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name))
    //.ForMember(dest => dest.DisplayName, opt => opt.MapFrom(src => src.DisplayName))
    .ForMember(dest => dest.Mandatory, opt => opt.MapFrom(src => src.Mandatory.HasValue ? src.Mandatory : false))
    .ForMember(dest => dest.Enabled, opt => opt.MapFrom(src => src.Enabled.HasValue ? src.Enabled : false))
    .ForMember(dest => dest.ReadOnly, opt => opt.MapFrom(src => src.ReadOnly.HasValue ? src.ReadOnly : false))
    ;
 
Mapper.AssertConfigurationIsValid();
0
Kristian Nikolov
Telerik team
answered on 09 Jul 2014, 11:13 AM
Hi Yannick,

Thank you for the provided information.

We tested the scenario using the same LINQ query but the exception could not be reproduced. When taking into account the previous attempts at reproduction, we do not currently think that there is a bug involved in the situation.

While the likely reason for the error was a temporary mapping discrepancy, it is interesting that "technicalname2" was not present anywhere in the model or database. Therefore, if you encounter a similar situation and are unable to identify the source which causes the usage of an incorrect column name, do not hesitate to make a backup of the .rlinq file exhibiting the error and send it to us.

I hope this helps. If you have additional questions feel free to post in our forums again.

Regards,
Kristian Nikolov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
0
Yannick
Top achievements
Rank 1
answered on 10 Jul 2014, 09:46 AM
Yep, i agree with your analyse.
if a similar situation rise again, i'll do an immediate complete snapshot.
Again, thx for the time spent.
Good continuation, and bests regards.

Y.
Tags
Data Access Free Edition
Asked by
Yannick
Top achievements
Rank 1
Answers by
Kristian Nikolov
Telerik team
Yannick
Top achievements
Rank 1
Share this question
or