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

Issue with OpenAccess DomainModel tool

1 Answer 87 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Graham Twaddle
Top achievements
Rank 1
Graham Twaddle asked on 24 May 2010, 01:48 PM

I have a problem with the default naming generaterd this for this database
here is a script to create the database you do not allow me to attach to the post as file :-(

------

USE

 

[TelerikTest]

 

GO

/****** Object: Table [dbo].[NodeType] Script Date: 05/24/2010 13:26:14 ******/

SET

 

ANSI_NULLS ON

 

GO

SET

 

QUOTED_IDENTIFIER ON

 

GO

CREATE

 

TABLE [dbo].[NodeType](

 

[NodeTypeID] [int]

IDENTITY(1,1) NOT NULL,

 

[Name] [nvarchar]

(50) NOT NULL,

 

 

CONSTRAINT [PK_NodeType] PRIMARY KEY CLUSTERED

 

(

[NodeTypeID]

ASC

 

)

 

WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

 

)

 

ON [PRIMARY]

 

GO

/****** Object: Table [dbo].[TreeType] Script Date: 05/24/2010 13:26:14 ******/

SET

 

ANSI_NULLS ON

 

GO

SET

 

QUOTED_IDENTIFIER ON

 

GO

CREATE

 

TABLE [dbo].[TreeType](

 

[TreeTypeID] [int]

IDENTITY(1,1) NOT NULL,

 

[Name] [nvarchar]

(50) NOT NULL,

 

 

CONSTRAINT [PK_TreeType] PRIMARY KEY CLUSTERED

 

(

[TreeTypeID]

ASC

 

)

 

WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

 

)

 

ON [PRIMARY]

 

GO

/****** Object: Table [dbo].[Tree] Script Date: 05/24/2010 13:26:14 ******/

SET

 

ANSI_NULLS ON

 

GO

SET

 

QUOTED_IDENTIFIER ON

 

GO

CREATE

 

TABLE [dbo].[Tree](

 

[TreeNodeID] [int]

IDENTITY(1,1) NOT NULL,

 

[NodeTypeID] [int]

NOT NULL,

 

[TreeTypeID] [int]

NOT NULL,

 

[NodeName] [nvarchar]

(50) NOT NULL,

 

[ParentNodeID] [int]

NULL,

 

[DEscription] [nvarchar]

(50) NULL,

 

[Level] [int]

NULL,

 

 

CONSTRAINT [PK_Tree] PRIMARY KEY CLUSTERED

 

(

[TreeNodeID]

ASC

 

)

 

WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

 

)

 

ON [PRIMARY]

 

GO

/****** Object: Table [dbo].[NodeTypeDetails] Script Date: 05/24/2010 13:26:14 ******/

SET

 

ANSI_NULLS ON

 

GO

SET

 

QUOTED_IDENTIFIER ON

 

GO

CREATE

 

TABLE [dbo].[NodeTypeDetails](

 

[NodeTypeDetailsID] [int]

IDENTITY(1,1) NOT NULL,

 

[NodeTYpeID] [int]

NOT NULL,

 

[MoreDescription] [nvarchar]

(50) NOT NULL,

 

 

CONSTRAINT [PK_NodeTypeDetails] PRIMARY KEY CLUSTERED

 

(

[NodeTypeDetailsID]

ASC

 

)

 

WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

 

)

 

ON [PRIMARY]

 

GO

/****** Object: ForeignKey [FK_NodeTypeDetails_NodeType] Script Date: 05/24/2010 13:26:14 ******/

ALTER

 

TABLE [dbo].[NodeTypeDetails] WITH CHECK ADD CONSTRAINT [FK_NodeTypeDetails_NodeType] FOREIGN KEY([NodeTYpeID])

 

REFERENCES

 

[dbo].[NodeType] ([NodeTypeID])

 

GO

ALTER

 

TABLE [dbo].[NodeTypeDetails] CHECK CONSTRAINT [FK_NodeTypeDetails_NodeType]

 

GO

/****** Object: ForeignKey [FK_Tree_NodeType] Script Date: 05/24/2010 13:26:14 ******/

ALTER

 

TABLE [dbo].[Tree] WITH CHECK ADD CONSTRAINT [FK_Tree_NodeType] FOREIGN KEY([NodeTypeID])

 

REFERENCES

 

[dbo].[NodeType] ([NodeTypeID])

 

GO

ALTER

 

TABLE [dbo].[Tree] CHECK CONSTRAINT [FK_Tree_NodeType]

 

GO

/****** Object: ForeignKey [FK_Tree_Parent] Script Date: 05/24/2010 13:26:14 ******/

ALTER

 

TABLE [dbo].[Tree] WITH CHECK ADD CONSTRAINT [FK_Tree_Parent] FOREIGN KEY([ParentNodeID])

 

REFERENCES

 

[dbo].[Tree] ([TreeNodeID])

 

GO

ALTER

 

TABLE [dbo].[Tree] CHECK CONSTRAINT [FK_Tree_Parent]

 

GO

/****** Object: ForeignKey [FK_Tree_TreeType] Script Date: 05/24/2010 13:26:14 ******/

ALTER

 

TABLE [dbo].[Tree] WITH CHECK ADD CONSTRAINT [FK_Tree_TreeType] FOREIGN KEY([TreeTypeID])

 

REFERENCES

 

[dbo].[TreeType] ([TreeTypeID])

 

GO

ALTER

 

TABLE [dbo].[Tree] CHECK CONSTRAINT [FK_Tree_TreeType]

 

GO


------

When I use create the datamodel form this ie

create a library c# project 

right click on new project  ->OpenAccess->Enable Project
right clik on the project add item -> Telerik Open Access Domain Model


follow the wizard select all database objects
  on the 'Define Naming Rules' tab 'Fields' change 'Add Prefix' to be _ 

now you will find the property for the table 'Tree' column 'ParentNodeID'

you generate
----

private

 

int _parentNodeID;

 

 

 

public virtual int ParentNodeID1

 

{

 

get

 

{

 

return _parentNodeID;

 

}

 

set

 

{

_parentNodeID =

value;

 

}

}


------

why have you generted a property ParentNodeID1 'ParentNodeID1' not 'ParentNodeID' 

------

I know I can go to the properties and alter the name that it will generate the correct property name but I donot want to have to do this for every property name you generate incorrectly

Is there a better way to do this or can you tell me why it has generated this? ( note this property is a foreign key back to the tree table i suspect this may be related to the issue)  

1 Answer, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 26 May 2010, 05:01 PM
Hi Graham Twaddle,

 We were able to reproduce this behavior and will fix this bug. Thank you for pointing it out. Your Telerik points have been updated.

All the best,
Ady
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Getting Started
Asked by
Graham Twaddle
Top achievements
Rank 1
Answers by
Ady
Telerik team
Share this question
or