zengcheng / codesmith

Automatically exported from code.google.com/p/codesmith
0 stars 0 forks source link

IsDbGenerated missing #510

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I'm not sure but think that in the first time I generated the code the ID 
column in the DB not marked as "Identity specification" since then every time I 
generate the code that entity missing IsDbGenerated property and I have to set 
it manually... 

What is the expected output? What do you see instead?
IsDbGenerated set to true if the column mark as "Identity specification" true. 

What version of the product are you using?

Please provide any additional information below.

Original issue reported on code.google.com by adiel.sh...@gmail.com on 4 Oct 2010 at 1:51

GoogleCodeExporter commented 9 years ago
Hello,

Does that table you are generating against have a primary key? If so, is this 
primary key an identity column?

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 5 Oct 2010 at 10:41

GoogleCodeExporter commented 9 years ago
Yes, 
this column is primary key and identity column
Thanks 
Adiel

Original comment by adiel.sh...@gmail.com on 5 Oct 2010 at 11:00

GoogleCodeExporter commented 9 years ago
Hello,

I have not been able to reproduce this with a table schema as defined below:

<Column Name="testID" Member="testID" Storage="_testID" Type="System.Int32" 
DbType="int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" 
CanBeNull="false" />

Could you please attach a sql script that will recreate your database table 
that I can test PLINQO against.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 19 Nov 2010 at 8:51

GoogleCodeExporter commented 9 years ago
Hi
this is the create script: 
USE [DBName]
GO

/****** Object:  Table [dbo].[Devices]    Script Date: 11/21/2010 13:53:34 
******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Devices](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [UserID] [int] NOT NULL,
    [DeviceType] [nvarchar](50) NOT NULL,
    [DeviceID] [nvarchar](50) NOT NULL,
    [StoredSignature] [image] NULL,
    [IsEnrolled] [bit] NOT NULL,
    [SecurityLevel] [int] NULL,
    [PassCounter] [int] NULL,
    [FailCounter] [int] NULL,
    [PushToken] [nvarchar](100) NULL,
 CONSTRAINT [PK_Devices] PRIMARY KEY CLUSTERED 
(
    [ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, 
ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

Thanks
Adiel

Original comment by adiel.sh...@gmail.com on 21 Nov 2010 at 11:55

GoogleCodeExporter commented 9 years ago
Hello,

I have been able to reproduce this issue and we will get this fixed. If you add 
the IsDbGenerated="true" attribute than it will be preserved across 
regeneration. But we currently don't update this attribute if it is added or 
removed to the database column.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 23 Nov 2010 at 10:42

GoogleCodeExporter commented 9 years ago
Hi  
In my experience I have to add this attribute in every regeneration. 

Let me know when it will be fixed. 
Thanks again 
Adiel

Original comment by hila...@gmail.com on 24 Nov 2010 at 1:55

GoogleCodeExporter commented 9 years ago
Hello,

If you are using the latest version of PLINQO and the latest version of 
CodeSmith Generator 5.3.1 and you have to add in the attribute every time. 
Could you please attach a two minute screen cast of this happening. I found 
this tool to be the best free screen cast utility 
(http://www.techsmith.com/jing/)

Please let me know if you have any questions.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 29 Nov 2010 at 7:24

GoogleCodeExporter commented 9 years ago
Hi 
I've download the last PLINQO and CodeSmith. 
The video attached.
Thanks

Original comment by adiel.sh...@gmail.com on 29 Nov 2010 at 3:59

Attachments:

GoogleCodeExporter commented 9 years ago
Hello,

Sorry for the late response. The attribute must be set in the DBML File in 
order to be preserved.

Example: <Column Name="CartId" Storage="_cartId" Type="System.Int32" 
DbType="int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" 
CanBeNull="false" />

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 8 Dec 2010 at 11:13

GoogleCodeExporter commented 9 years ago
Many Thanks!!!! 

Original comment by adiel.sh...@gmail.com on 12 Dec 2010 at 4:13