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

I have problem with junker table - collection object in ORM

3 Answers 41 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ahmed
Top achievements
Rank 1
Ahmed asked on 12 May 2012, 09:01 AM
Dear all : any help me please ,

I have a problem with junker table which it represented in Open Access  as a collection 
I work with open-access 2011 , file version : 2011, 3, 1129, 2

I get error when return the collection list from object entity 
============
the error is :
Invalid object name 'UserMapGroup'.
Statement(s) could not be prepared. 

note: ["UserMapGroup" - is the Collection Object between table User and group]

Stack Trace: 
[SQLException: Invalid object name 'UserMapGroup'.
Statement(s) could not be prepared.]
   Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery() +499
   OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery() +118
   OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute() +152

[DataStoreException: Error executing query: Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'UserMapGroup'.
Statement(s) could not be prepared.
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()
   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()
   at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
SQL:
SELECT b.[UserId] AS COL1, c.[GroupId] AS COL2, c.[SectionId] AS COL3 FROM [AdminSchema].[LookUpUser] a JOIN [UserMapGroup] AS b ON (a.[UserId] = b.[UserId]) JOIN [AdminSchema].[LookupGroup] AS c ON (b.[GroupId] = c.[GroupId]) WHERE a.[UserId] = ?                                       ORDER BY b.[UserId]  Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'UserMapGroup'.
Statement(s) could not be prepared.
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()
   at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()
   at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()]
   Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +28
   OpenAccessRuntime.ExceptionWrapper.Throw() +34
   OpenAccessRuntime.DataObjects.PCStateMan.handleException(Exception x) +90
   OpenAccessRuntime.DataObjects.PCStateMan.getObjectFieldImp(PersistenceCapable pc, FieldMetaData fmd, Object currentValue) +189
   OpenAccessRuntime.DataObjects.PCStateMan.GetObjectField(PersistenceCapable pc, Int32 field, Object currentValue) +69
   OpenAccessRuntime.DataObjects.SynchronizedStateManagerProxy.GetObjectField(PersistenceCapable pc, Int32 field, Object currentValue) +196
   Arcom.OA.NewsWizV4AdminEntity.LookUpUser.OpenAccessEnhancedGetuserMapGroup(LookUpUser ) +123
   Arcom.OA.NewsWizV4AdminEntity.LookUpUser.get_UserMapGroups() in C:\Mohany-SpaWS\Arcom.Projects.NewsWiz\Arcom.OA.NewsWizV4AdminEntity\LookUpUser.cs:201
   Arcom.NewsWiz.Admin.ServiceAdmin.userAdmin.UserOnFoucs.FillRadListBoxUserGroups() in C:\Mohany-SpaWS\Arcom.Projects.NewsWiz\Arcom.NewsWiz.Admin\ServiceAdmin\userAdmin\UserOnFoucs.aspx.cs:46
   Arcom.NewsWiz.Admin.ServiceAdmin.userAdmin.UserOnFoucs.Page_Load(Object sender, EventArgs e) in C:\Mohany-SpaWS\Arcom.Projects.NewsWiz\Arcom.NewsWiz.Admin\ServiceAdmin\userAdmin\UserOnFoucs.aspx.cs:30
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +37
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +95
   System.Web.UI.Control.OnLoad(EventArgs e) +145
   System.Web.UI.Control.LoadRecursive() +134
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3412


 

3 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 14 May 2012, 11:29 AM
Hi Ahmed,

it seems that you added the collection to the domain model. But then the database was not updated and therefore the needed join table does not exist. Please perform the 'Update Database' step (right klick on the .rlinq surface).

Kind regards,
Thomas
the Telerik team
Follow @OpenAccessORM Twitter channel to get first the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
0
Ahmed
Top achievements
Rank 1
answered on 15 May 2012, 10:13 AM
Hi Thomas  , Thank you for your interest

i will explaine what happen with me ,
first i work wiht object scope not with domain modle

the project work will with me from 5 months , i was work with Open access 2010
and i upgrad to 2011

and suddenly , i check the project , I get an erroe about the datatybe of field on database with tybe 'tiyint' which its represented as Sbyte
the erroe is the new orm  not support 'SByte' type and nead to convert it to 'byte'

and  i make new revers mab and change the type 'Sbyte' in code to byet

.... => After that the problem of junker represented , it seam as the collection object not exist while it  exist in entity class as I List
the project build successfully , the error represented  
on run time .



0
Thomas
Telerik team
answered on 18 May 2012, 12:49 PM
Hi Ahmed,

I dot not fully understand yet why the join is missing. What I know is that for MSSQL, the tinyint data type is of range 0...255, so a System.Byte is best used to represent the value. In past versions, a column of this type might have been handled with the SByte type, but changing the mapped type of a column should not influence the creation of join tables. Is there any other change that you did to the project? Can you use the newest version as well?

Kind regards,
Thomas
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Tags
Databases and Data Types
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Ahmed
Top achievements
Rank 1
Share this question
or