inhertitance -> target per entity hierarchy, data type Timestamp

Posts   
 
    
chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 06-Dec-2010 12:51:56   

hi,

first: newest llblgen.exe, target: entity framework 4.0, vs 2010, windows 7 64, ms sql server 2008 r2. problem: the following text, generated in the edmx file:

<EntitySetMapping Name="Folder">

<EntityTypeMapping TypeName="IsTypeOf(SmcModel.FolderForUnit)">

    <MappingFragment StoreEntitySet="Folder">

        <ScalarProperty Name="Name" ColumnName="Name" />

        <ScalarProperty Name="RowId" ColumnName="RowId" />

        <ScalarProperty Name="Xcoord" ColumnName="Xcoord" />

        <ScalarProperty Name="Ycoord" ColumnName="Ycoord" />

        <Condition ColumnName="FolderType" Value="new Guid("0b303abe-66d2-4db9-8363-363682702de7")" />

    </MappingFragment>

</EntityTypeMapping>

<EntityTypeMapping TypeName="SmcModel.Folder">

    <MappingFragment StoreEntitySet="Folder">

        <ScalarProperty Name="Name" ColumnName="Name" />

        <ScalarProperty Name="RowId" ColumnName="RowId" />

        <ScalarProperty Name="Xcoord" ColumnName="Xcoord" />

        <ScalarProperty Name="Ycoord" ColumnName="Ycoord" />

        <Condition ColumnName="FolderType" Value="new Guid("")" />

    </MappingFragment>

</EntityTypeMapping>

</EntitySetMapping>

errors are produced for the both line beginning with: <Condition ColumnName ...

what do ihave to do to avoid these errors. i searched for a detailed documantation on how to define the inheritance in detail. and did not find anything (detailed, with examples).

another problem is, the data type TIMESTAMP. i have one attribute defined as TIMESTAMP. the result in the edmx file is: <Property Name="Timestamp" Type="timestamp" Nullable="false" MaxLength="8" />. this leads to an error too, because attributes of type TIMESTAMP must not define a MaxLength.

thanx in advance for answering fast,

regards

chris

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 06-Dec-2010 15:09:03   

errors are produced for the both line beginning with: <Condition ColumnName ...

what do ihave to do to avoid these errors.

Please provide the errors.

chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 06-Dec-2010 16:01:50   

ok,

here they come.

for the first error:

Error 1 Name cannot begin with the '0' character, hexadecimal value 0x30. Line 1884, position 61. D:\DevProjects\SMC-1100 Office\trunk\main\Source\CAG.Framework\Smc\Persistence\Smc.edmx 1885 62 CAG.Framework.Data.Smc.Persistence

Error 2 Missing required whitespace. D:\DevProjects\SMC-1100 Office\trunk\main\Source\CAG.Framework\Smc\Persistence\Smc.edmx 1884 61 CAG.Framework.Data.Smc.Persistence

Error 3 The character '0', hexadecimal value 0x30 is illegal at the beginning of an XML name. D:\DevProjects\SMC-1100 Office\trunk\main\Source\CAG.Framework\Smc\Persistence\Smc.edmx 1884 61 CAG.Framework.Data.Smc.Persistence

and so on. but if you like it easy, just take a look on how the quotation marks are set.

the second error:

Error 1 Error 64: Facet 'MaxLength' must not be specified for type 'timestamp'. D:\DevProjects\SMC-1100 Office\trunk\main\Source\CAG.Framework\Smc\Persistence\Smc.edmx 375 6 CAG.Framework.Data.Smc.Persistence

and please, provide me with a hint w\to where i can find a detailed documentation on inheritance in llblgen pro designer. and if possible, perhaps today?

thank you very much for answering,

regards

chris

chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 06-Dec-2010 16:46:26   

hello,

is there anyone out there. i at least need a hint to where i can find a detailed documentation about inheritance.

thank you very much for your help in advance,

regards

chris

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 07-Dec-2010 08:25:05   

Could you please attach a repro llblgen project file.

chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 07-Dec-2010 09:34:18   

hi, thank you very much for answering fast. i have attached the asked project file. could you on the other hand side provide me with a hint on where i can find detailed information about inhertiance in llblgen pro 3.0.

thank you very much,

regards

chris

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 07-Dec-2010 10:00:07   

We are checking the attached project.

About Inheritance documentation, please check this and this this

chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 07-Dec-2010 10:04:42   

hi,

thank you for answering. i already red this. i need a detailed documentation because if i do what is written in this docu i get the reprorted problems. as long i can not get a explanation from you, i have to try to find one myself. so the best would be, if you provide me with the information about where i can find an example.

thank you very much,

regards

chris

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 07-Dec-2010 10:46:45   

The project file you have specified, doesn't have the FolderForUnit entity. And so no conditions for it or for the Folder entity have been specified in the produuced edmx file.

But I can see the error of the MaxLength.

About Inheritance, if the documentation is not enough, could you please specify what you need to do so we can guide you.

chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 07-Dec-2010 13:02:10   

hi,

sure, i had to delete the inheritance because otherwise i am running out of my time scope. so, if you want a project file with an inheritance included, just let me know, i will prepare one for you. otherwise, if you look on the data i have copied in this thread you will see a fault setting of quotation marks. here, again, is the part which has the quotation mark setting error:

<Condition ColumnName="FolderType" Value="new Guid("0b303abe-66d2-4db9-8363-363682702de7")" />

and

<Condition ColumnName="FolderType" Value="new Guid("")" />

perhaps it helps further to know that we use attributes of data type GUID as primary keys (and so the foreign keys are of data type GUID too).

what i now want to define is a inheritance by entity hierarchy. as far as i understood i have to define an entity (FOLDERFORUNIT), for this entity i have to define that it is a subtype of another entity (FOLDER). then i choose the discriminator field of the supertype (attribute FOLDERTYPE of data type GUID). now the problems begin. where to write the discriminator value exactly). in the dialog i find two possibilites: FOLDER and FOLDERFORUNIT. if i try to put the same value in both i get an error from llblgen pro 3.0. so, what to do? it would be enough to see an example on how it works. where can i find one?

thank you very much,

regards

chris

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Dec-2010 15:11:53   

You use the latest build of llblgen pro v3? If not, please download the latest build to exclude issues we already fixed ...

Frans Bouma | Lead developer LLBLGen Pro
chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 07-Dec-2010 15:14:07   

i just downloaded the llblgenpro.exe file from 03.12.2010. sure, my project is older, but i regenerated the code yesterday to see, if the problems i have are solved.

thank you,

regards

chris

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Dec-2010 17:02:00   

We'll look into it.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Dec-2010 17:12:50   

Ok there are 3 things with this project: 1) maxLength is emitted on a fieldtype of type 'timestamp'. This should not be done 2) The linq query emitted for the typedlist is wrong. (two times the field name). 3) you say when one uses a Guid as discriminator value, the value is emitted as string and has wrong quotes. This indeed should not be the case.

We'll try to fix those 3 items a.s.a.p.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Dec-2010 17:18:01   

Fixed the maxlength problem.

Looking into linq query.

(edit) this is a bug with respect to not having FK fields emitted and the PK field is also an FK field.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Dec-2010 18:09:21   

Linq query problem fixed. Looking into the Guid stuff.

(edit) this requires a fix in the designer's generator utils, which wrap string and guid with "". This should be configurable from the template.

Will be tomorrow (wednesday).

I've attached a fixed generalTemplateUtils.lpt template, which fixes the first two problems so you can continue.

Place the template in the folder: <llblgen pro installation folder>\Frameworks\Entity Framework\Templates\Shared\Shared

as administrator.

Attachments
Filename File size Added on Approval
generalTemplateUtils.lpt 18,655 07-Dec-2010 18:17.31 Approved
Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 08-Dec-2010 18:09:24   

For strings, it shouldn't wrap it into quotes. Guids, it seems aren't supported for discriminator fields in EF (no documentation on this, but their designer throws an error on this). So we've fixed it for strings only (which should work properly of course).

Fixed in next build (coming tomorrow)

Frans Bouma | Lead developer LLBLGen Pro
chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 09-Dec-2010 09:35:46   

hi,

after a holiday i am back. great, thank you very much for such fast reaction (after it took a little warm up). i will download the next version as it is online and regenerate my code.

regards

chris