Is there a way to generate the model by code? I need to modify the model after is generated and I want to automate this procedure writing a utility in c#.
Thanks
Search found 14 matches
- Fri 03 Sep 2010 07:57
- Forum: Entity Developer
- Topic: Model generation by code
- Replies: 1
- Views: 1852
- Mon 05 Apr 2010 13:35
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Multiple query with collection
- Replies: 9
- Views: 2216
- Wed 31 Mar 2010 09:54
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Multiple query with collection
- Replies: 9
- Views: 2216
- Thu 18 Mar 2010 09:28
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Multiple query with collection
- Replies: 9
- Views: 2216
- Tue 16 Mar 2010 14:27
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Multiple query with collection
- Replies: 9
- Views: 2216
Multiple query with collection
I have this Northwind query:
var query = from o in context.ORDERS
select new myORDERS() {
ORDERID = o.ORDERID,
ORDERDETAILS = from d in o.ORDERDETAILS select new myORDERDETAILS() {
PRODUCTID=d.PRODUCTID,
},
};
where myORDERS and myORDERDETAILS are my business objects.
If I try to run the query with the Microsoft provider for Sql Server System.Data.SqlClient in sql monitor I have the current query:
SELECT [t0].[ORDERID], [t1].[PRODUCTID], (
SELECT COUNT(*)
FROM [dbo].[ORDERDETAILS] AS [t2]
WHERE [t2].[ORDERID] = [t0].[ORDERID]
) AS [value]
FROM [dbo].[ORDERS] AS [t0]
LEFT OUTER JOIN [dbo].[ORDERDETAILS] AS [t1] ON [t1].[ORDERID] = [t0].[ORDERID]
ORDER BY [t0].[ORDERID], [t1].[PRODUCTID]
If I run the same query with Devart driver for Oracle I obtain the following sql queries:
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11073
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11074
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11075
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11076
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11077
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 12000
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 12001
This behaviour causes decrease of performance. If I not map the LINQ query in my custom objects the behaviour is the same as Microsoft driver.
Thanks
var query = from o in context.ORDERS
select new myORDERS() {
ORDERID = o.ORDERID,
ORDERDETAILS = from d in o.ORDERDETAILS select new myORDERDETAILS() {
PRODUCTID=d.PRODUCTID,
},
};
where myORDERS and myORDERDETAILS are my business objects.
If I try to run the query with the Microsoft provider for Sql Server System.Data.SqlClient in sql monitor I have the current query:
SELECT [t0].[ORDERID], [t1].[PRODUCTID], (
SELECT COUNT(*)
FROM [dbo].[ORDERDETAILS] AS [t2]
WHERE [t2].[ORDERID] = [t0].[ORDERID]
) AS [value]
FROM [dbo].[ORDERS] AS [t0]
LEFT OUTER JOIN [dbo].[ORDERDETAILS] AS [t1] ON [t1].[ORDERID] = [t0].[ORDERID]
ORDER BY [t0].[ORDERID], [t1].[PRODUCTID]
If I run the same query with Devart driver for Oracle I obtain the following sql queries:
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11073
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11074
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11075
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11076
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11077
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 12000
SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 12001
This behaviour causes decrease of performance. If I not map the LINQ query in my custom objects the behaviour is the same as Microsoft driver.
Thanks
- Mon 15 Feb 2010 09:32
- Forum: LinqConnect (LINQ to SQL support)
- Topic: Exceptions with new beta version
- Replies: 3
- Views: 1567
- Mon 01 Feb 2010 11:42
- Forum: LinqConnect (LINQ to SQL support)
- Topic: DeferredSource
- Replies: 4
- Views: 1768
- Fri 29 Jan 2010 13:51
- Forum: LinqConnect (LINQ to SQL support)
- Topic: DeferredSource
- Replies: 4
- Views: 1768
deferred loading
In reference to the previous code, there is a difference in the behavior
between Microsoft linq to sql and yours.
The problem is after executing result.ToList() and disposing context:
if we browse PRODUCTS, provider thows an Exception because want to access database although deferred loading is disabled.
Here is sample code with orders and detail
static void test1(){
string connection = "Password=northwind;User ID=northwind;Data Source=ora10g";
MyOrder alfkiOrders;
using (Northwind.Northwind entities =new Northwind.Northwind(connection)) {
entities.ObjectTrackingEnabled = false;
entities.DeferredLoadingEnabled = false;
// -- dal tier
IQueryable qResult = from o in entities.ORDERs
select new MyOrder {
ORDERID = o.ORDERID,
CUSTOMERID = o.CUSTOMERID,
Detail = from d in o.ORDERDETAILs
select new MyOrderDetail() {
ORDERID=d.ORDERID,
PRODUCTID=d.PRODUCTID,
QUANTITY=d.QUANTITY,
},
};
// -- biz tier
alfkiOrders = qResult.Where(order => order.CUSTOMERID == "ALFKI").First();
}
// accessing alfki order detail
foreach (var item in alfkiOrders.Detail) {
item.QUANTITY=22;
// Error!! IEnumerable execute deferred loading after "First()" or "ToList()" operation
}
}
static void test2() {
// trying with a list
string connection = "Password=northwind;User ID=northwind;Data Source=ora10g";
MyOrder alfkiOrders;
using (Northwind.Northwind entities = new Northwind.Northwind(connection)) {
entities.ObjectTrackingEnabled = false;
entities.DeferredLoadingEnabled = false;
// -- dal tier
IQueryable qResult = from o in entities.ORDERs
select new MyOrder {
ORDERID = o.ORDERID,
CUSTOMERID = o.CUSTOMERID,
Detail = new List(
from d in o.ORDERDETAILs
select new MyOrderDetail() {
ORDERID = d.ORDERID,
PRODUCTID = d.PRODUCTID,
QUANTITY = d.QUANTITY,
}
),
};
// -- biz tier
var allOrders = qResult.ToList(); //ok
alfkiOrders = qResult.Where(order => order.CUSTOMERID == "ALFKI").First(); // error
}
// accessing alfki order detail
foreach (var item in alfkiOrders.Detail) {
item.QUANTITY = 22;
// Error!! IEnumerable execute deferred loading after "First()" or "ToList()" operation
}
}
thanks!
between Microsoft linq to sql and yours.
The problem is after executing result.ToList() and disposing context:
if we browse PRODUCTS, provider thows an Exception because want to access database although deferred loading is disabled.
Here is sample code with orders and detail
static void test1(){
string connection = "Password=northwind;User ID=northwind;Data Source=ora10g";
MyOrder alfkiOrders;
using (Northwind.Northwind entities =new Northwind.Northwind(connection)) {
entities.ObjectTrackingEnabled = false;
entities.DeferredLoadingEnabled = false;
// -- dal tier
IQueryable qResult = from o in entities.ORDERs
select new MyOrder {
ORDERID = o.ORDERID,
CUSTOMERID = o.CUSTOMERID,
Detail = from d in o.ORDERDETAILs
select new MyOrderDetail() {
ORDERID=d.ORDERID,
PRODUCTID=d.PRODUCTID,
QUANTITY=d.QUANTITY,
},
};
// -- biz tier
alfkiOrders = qResult.Where(order => order.CUSTOMERID == "ALFKI").First();
}
// accessing alfki order detail
foreach (var item in alfkiOrders.Detail) {
item.QUANTITY=22;
// Error!! IEnumerable execute deferred loading after "First()" or "ToList()" operation
}
}
static void test2() {
// trying with a list
string connection = "Password=northwind;User ID=northwind;Data Source=ora10g";
MyOrder alfkiOrders;
using (Northwind.Northwind entities = new Northwind.Northwind(connection)) {
entities.ObjectTrackingEnabled = false;
entities.DeferredLoadingEnabled = false;
// -- dal tier
IQueryable qResult = from o in entities.ORDERs
select new MyOrder {
ORDERID = o.ORDERID,
CUSTOMERID = o.CUSTOMERID,
Detail = new List(
from d in o.ORDERDETAILs
select new MyOrderDetail() {
ORDERID = d.ORDERID,
PRODUCTID = d.PRODUCTID,
QUANTITY = d.QUANTITY,
}
),
};
// -- biz tier
var allOrders = qResult.ToList(); //ok
alfkiOrders = qResult.Where(order => order.CUSTOMERID == "ALFKI").First(); // error
}
// accessing alfki order detail
foreach (var item in alfkiOrders.Detail) {
item.QUANTITY = 22;
// Error!! IEnumerable execute deferred loading after "First()" or "ToList()" operation
}
}
thanks!
- Mon 25 Jan 2010 17:33
- Forum: LinqConnect (LINQ to SQL support)
- Topic: DeferredSource
- Replies: 4
- Views: 1768
DeferredSource
I have a method that map an entity from the context to my domain model like this:
public IQueryable ReadAll()
{
IQueryable result = null;
this.Context.ObjectTrackingEnabled = false;
this.Context.DeferredLoadingEnabled = false;
result = from a in this.Context.CATEGORIES
select new DomainModel.CATEGORIES
{
CATEGORYID = a.CATEGORYID,
CATEGORYNAME = a.CATEGORYNAME,
DESCRIPTION = a.DESCRIPTION,
PICTURE = a.PICTURE,
PRODUCTS = (from b in a.PRODUCTS select new DomainModel.PRODUCTS {
DISCONTINUED = b.DISCONTINUED,
PRODUCTID = b.PRODUCTID,
PRODUCTNAME = b.PRODUCTNAME,
QUANTITYPERUNIT = b.QUANTITYPERUNIT,
REORDERLEVEL = b.REORDERLEVEL,
UNITPRICE = b.UNITPRICE,
UNITSINSTOCK = b.UNITSINSTOCK,
UNITSONORDER = b.UNITSONORDER,
}),
};
return result;
}
Why when I do a linq query over the IQueryable I obtain an object of type DomainModel.CATEGORIES with a collection of type Devart.Data.Linq.Provider.DeferredSource insted of type DomainModel.PRODUCTS?
Thanks
public IQueryable ReadAll()
{
IQueryable result = null;
this.Context.ObjectTrackingEnabled = false;
this.Context.DeferredLoadingEnabled = false;
result = from a in this.Context.CATEGORIES
select new DomainModel.CATEGORIES
{
CATEGORYID = a.CATEGORYID,
CATEGORYNAME = a.CATEGORYNAME,
DESCRIPTION = a.DESCRIPTION,
PICTURE = a.PICTURE,
PRODUCTS = (from b in a.PRODUCTS select new DomainModel.PRODUCTS {
DISCONTINUED = b.DISCONTINUED,
PRODUCTID = b.PRODUCTID,
PRODUCTNAME = b.PRODUCTNAME,
QUANTITYPERUNIT = b.QUANTITYPERUNIT,
REORDERLEVEL = b.REORDERLEVEL,
UNITPRICE = b.UNITPRICE,
UNITSINSTOCK = b.UNITSINSTOCK,
UNITSONORDER = b.UNITSONORDER,
}),
};
return result;
}
Why when I do a linq query over the IQueryable I obtain an object of type DomainModel.CATEGORIES with a collection of type Devart.Data.Linq.Provider.DeferredSource insted of type DomainModel.PRODUCTS?
Thanks
- Tue 07 Apr 2009 07:26
- Forum: Entity Framework support
- Topic: New version, very bad for me
- Replies: 3
- Views: 2974
- Mon 06 Apr 2009 10:41
- Forum: Entity Framework support
- Topic: New version, very bad for me
- Replies: 3
- Views: 2974
New version, very bad for me
I'm very, very angry. I develop a tool to generate n-tier application based on edmx file generated from VS2008. With the 4 version of OraDirect.NET, no problem. I was able to generate the edmx with all associations. Now with the new version 5 of dotConnect for Oracle I get this error:
The relationship 'ONHOSPITAL.T_AMB_CONSULENZE_DETTAGLIO_APP' has columns that are not part of the key of the table on the primary side of the relationship which is not supported, the relationship was excluded.
but the relationship is correctly generated in Oracle.
This appens when the relationship is multi-columns.
I can't use EntityDeveloper because doesn't generate edmx, is very slow and, for entity framework, is not free. Please, tell me if you mean to solve this problem in next release otherwise I'm forced to change provider.
The relationship 'ONHOSPITAL.T_AMB_CONSULENZE_DETTAGLIO_APP' has columns that are not part of the key of the table on the primary side of the relationship which is not supported, the relationship was excluded.
but the relationship is correctly generated in Oracle.
This appens when the relationship is multi-columns.
I can't use EntityDeveloper because doesn't generate edmx, is very slow and, for entity framework, is not free. Please, tell me if you mean to solve this problem in next release otherwise I'm forced to change provider.
- Wed 11 Mar 2009 15:30
- Forum: Entity Framework support
- Topic: Problem handling large Oracle database
- Replies: 6
- Views: 4681
I have the same problem. I download the latest version of dotConnect for Oracle 5.0.22.0 and generating the edmx I get this error:
The relationship 'ONHOSPITAL.T_AMB_APP_PRESTAZIONI_R01' has columns that are not part of the key of the table on the primary side of the relationship which is not supported, the relationship was excluded
The relationship script is:
ALTER TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI ADD (
CONSTRAINT T_AMB_APP_PRESTAZIONI_R01
FOREIGN KEY (TAP_APP_NUMERO, TAP_APP_RIC_CODICE, TAP_AZI_CODICE)
REFERENCES ONHOSPITAL.T_AMB_APPUNTAMENTI (APP_NUMERO,APP_RIC_CODICE,APP_AZI_CODICE)
The script for the master table T_AMB_APPUNTAMENTI is:
CREATE TABLE ONHOSPITAL.T_AMB_APPUNTAMENTI
(
APP_NUMERO NUMBER(5) NOT NULL,
APP_RIC_CODICE VARCHAR2(12 BYTE) NOT NULL,
APP_UNI_CODICE NUMBER(5) NOT NULL,
APP_SED_CODICE NUMBER(5),
APP_DATA_ORA DATE NOT NULL,
APP_DURATA NUMBER(5),
APP_STA_CODICE NUMBER(5) NOT NULL,
APP_DATA_REGISTRAZIONE DATE NOT NULL,
APP_UTE_REGISTRAZIONE NUMBER(10) NOT NULL,
APP_APP_NUMERO NUMBER(5),
APP_ACC_NUMERO NUMBER(8),
APP_TIPO_AGENDA VARCHAR2(1 BYTE),
APP_FASCIA_CUP VARCHAR2(8 BYTE),
APP_DATA_SPOSTAMENTO DATE,
APP_UTE_SPOSTAMENTO NUMBER(10),
APP_DATA_REVOCA DATE,
APP_UTE_REVOCA NUMBER(10),
APP_NOTE VARCHAR2(4000 BYTE),
APP_CODICE NUMBER(8),
APP_AZI_CODICE VARCHAR2(10 BYTE) DEFAULT '080112' NOT NULL,
APP_DATA_ORA_ARROT DATE
);
ALTER TABLE ONHOSPITAL.T_AMB_APPUNTAMENTI ADD (
CONSTRAINT T_AMB_APPUNTAMENTI_PK
PRIMARY KEY
(APP_NUMERO, APP_RIC_CODICE, APP_AZI_CODICE);
And the script for the detail table T_AMB_APP_PRESTAZIONI is:
CREATE TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI
(
TAP_APP_NUMERO NUMBER(5) NOT NULL,
TAP_PRE_CODICE NUMBER(5) NOT NULL,
TAP_PRF_CODICE NUMBER(5),
TAP_AZI_CODICE VARCHAR2(10 BYTE) DEFAULT '080112' NOT NULL,
TAP_APP_RIC_CODICE VARCHAR2(12 BYTE) NOT NULL,
TAP_UNIERO_DEFAULT VARCHAR2(1 BYTE)
);
ALTER TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI ADD (
CONSTRAINT T_AMB_APP_PRESTAZIONI_PK
PRIMARY KEY
(TAP_APP_NUMERO, TAP_PRE_CODICE, TAP_AZI_CODICE, TAP_APP_RIC_CODICE);
With version 4.75.43.0, I was able to generate edmx without any problem.
So I can't migrate to new version
The relationship 'ONHOSPITAL.T_AMB_APP_PRESTAZIONI_R01' has columns that are not part of the key of the table on the primary side of the relationship which is not supported, the relationship was excluded
The relationship script is:
ALTER TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI ADD (
CONSTRAINT T_AMB_APP_PRESTAZIONI_R01
FOREIGN KEY (TAP_APP_NUMERO, TAP_APP_RIC_CODICE, TAP_AZI_CODICE)
REFERENCES ONHOSPITAL.T_AMB_APPUNTAMENTI (APP_NUMERO,APP_RIC_CODICE,APP_AZI_CODICE)
The script for the master table T_AMB_APPUNTAMENTI is:
CREATE TABLE ONHOSPITAL.T_AMB_APPUNTAMENTI
(
APP_NUMERO NUMBER(5) NOT NULL,
APP_RIC_CODICE VARCHAR2(12 BYTE) NOT NULL,
APP_UNI_CODICE NUMBER(5) NOT NULL,
APP_SED_CODICE NUMBER(5),
APP_DATA_ORA DATE NOT NULL,
APP_DURATA NUMBER(5),
APP_STA_CODICE NUMBER(5) NOT NULL,
APP_DATA_REGISTRAZIONE DATE NOT NULL,
APP_UTE_REGISTRAZIONE NUMBER(10) NOT NULL,
APP_APP_NUMERO NUMBER(5),
APP_ACC_NUMERO NUMBER(8),
APP_TIPO_AGENDA VARCHAR2(1 BYTE),
APP_FASCIA_CUP VARCHAR2(8 BYTE),
APP_DATA_SPOSTAMENTO DATE,
APP_UTE_SPOSTAMENTO NUMBER(10),
APP_DATA_REVOCA DATE,
APP_UTE_REVOCA NUMBER(10),
APP_NOTE VARCHAR2(4000 BYTE),
APP_CODICE NUMBER(8),
APP_AZI_CODICE VARCHAR2(10 BYTE) DEFAULT '080112' NOT NULL,
APP_DATA_ORA_ARROT DATE
);
ALTER TABLE ONHOSPITAL.T_AMB_APPUNTAMENTI ADD (
CONSTRAINT T_AMB_APPUNTAMENTI_PK
PRIMARY KEY
(APP_NUMERO, APP_RIC_CODICE, APP_AZI_CODICE);
And the script for the detail table T_AMB_APP_PRESTAZIONI is:
CREATE TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI
(
TAP_APP_NUMERO NUMBER(5) NOT NULL,
TAP_PRE_CODICE NUMBER(5) NOT NULL,
TAP_PRF_CODICE NUMBER(5),
TAP_AZI_CODICE VARCHAR2(10 BYTE) DEFAULT '080112' NOT NULL,
TAP_APP_RIC_CODICE VARCHAR2(12 BYTE) NOT NULL,
TAP_UNIERO_DEFAULT VARCHAR2(1 BYTE)
);
ALTER TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI ADD (
CONSTRAINT T_AMB_APP_PRESTAZIONI_PK
PRIMARY KEY
(TAP_APP_NUMERO, TAP_PRE_CODICE, TAP_AZI_CODICE, TAP_APP_RIC_CODICE);
With version 4.75.43.0, I was able to generate edmx without any problem.
So I can't migrate to new version
- Wed 11 Mar 2009 15:29
- Forum: Entity Framework support
- Topic: Problem handling large Oracle database
- Replies: 6
- Views: 4681
I have the same problem. I download the latest version of dotConnect for Oracle 5.0.22.0 and generating the edmx I get this error:
The relationship 'ONHOSPITAL.T_AMB_APP_PRESTAZIONI_R01' has columns that are not part of the key of the table on the primary side of the relationship which is not supported, the relationship was excluded
The relationship script is:
ALTER TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI ADD (
CONSTRAINT T_AMB_APP_PRESTAZIONI_R01
FOREIGN KEY (TAP_APP_NUMERO, TAP_APP_RIC_CODICE, TAP_AZI_CODICE)
REFERENCES ONHOSPITAL.T_AMB_APPUNTAMENTI (APP_NUMERO,APP_RIC_CODICE,APP_AZI_CODICE)
The script for the master table T_AMB_APPUNTAMENTI is:
CREATE TABLE ONHOSPITAL.T_AMB_APPUNTAMENTI
(
APP_NUMERO NUMBER(5) NOT NULL,
APP_RIC_CODICE VARCHAR2(12 BYTE) NOT NULL,
APP_UNI_CODICE NUMBER(5) NOT NULL,
APP_SED_CODICE NUMBER(5),
APP_DATA_ORA DATE NOT NULL,
APP_DURATA NUMBER(5),
APP_STA_CODICE NUMBER(5) NOT NULL,
APP_DATA_REGISTRAZIONE DATE NOT NULL,
APP_UTE_REGISTRAZIONE NUMBER(10) NOT NULL,
APP_APP_NUMERO NUMBER(5),
APP_ACC_NUMERO NUMBER(8),
APP_TIPO_AGENDA VARCHAR2(1 BYTE),
APP_FASCIA_CUP VARCHAR2(8 BYTE),
APP_DATA_SPOSTAMENTO DATE,
APP_UTE_SPOSTAMENTO NUMBER(10),
APP_DATA_REVOCA DATE,
APP_UTE_REVOCA NUMBER(10),
APP_NOTE VARCHAR2(4000 BYTE),
APP_CODICE NUMBER(8),
APP_AZI_CODICE VARCHAR2(10 BYTE) DEFAULT '080112' NOT NULL,
APP_DATA_ORA_ARROT DATE
);
ALTER TABLE ONHOSPITAL.T_AMB_APPUNTAMENTI ADD (
CONSTRAINT T_AMB_APPUNTAMENTI_PK
PRIMARY KEY
(APP_NUMERO, APP_RIC_CODICE, APP_AZI_CODICE);
And the script for the detail table T_AMB_APP_PRESTAZIONI is:
CREATE TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI
(
TAP_APP_NUMERO NUMBER(5) NOT NULL,
TAP_PRE_CODICE NUMBER(5) NOT NULL,
TAP_PRF_CODICE NUMBER(5),
TAP_AZI_CODICE VARCHAR2(10 BYTE) DEFAULT '080112' NOT NULL,
TAP_APP_RIC_CODICE VARCHAR2(12 BYTE) NOT NULL,
TAP_UNIERO_DEFAULT VARCHAR2(1 BYTE)
);
ALTER TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI ADD (
CONSTRAINT T_AMB_APP_PRESTAZIONI_PK
PRIMARY KEY
(TAP_APP_NUMERO, TAP_PRE_CODICE, TAP_AZI_CODICE, TAP_APP_RIC_CODICE);
With version 4.75.43.0, I was able to generate edmx without any problem.
So I can't migrate to new version
The relationship 'ONHOSPITAL.T_AMB_APP_PRESTAZIONI_R01' has columns that are not part of the key of the table on the primary side of the relationship which is not supported, the relationship was excluded
The relationship script is:
ALTER TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI ADD (
CONSTRAINT T_AMB_APP_PRESTAZIONI_R01
FOREIGN KEY (TAP_APP_NUMERO, TAP_APP_RIC_CODICE, TAP_AZI_CODICE)
REFERENCES ONHOSPITAL.T_AMB_APPUNTAMENTI (APP_NUMERO,APP_RIC_CODICE,APP_AZI_CODICE)
The script for the master table T_AMB_APPUNTAMENTI is:
CREATE TABLE ONHOSPITAL.T_AMB_APPUNTAMENTI
(
APP_NUMERO NUMBER(5) NOT NULL,
APP_RIC_CODICE VARCHAR2(12 BYTE) NOT NULL,
APP_UNI_CODICE NUMBER(5) NOT NULL,
APP_SED_CODICE NUMBER(5),
APP_DATA_ORA DATE NOT NULL,
APP_DURATA NUMBER(5),
APP_STA_CODICE NUMBER(5) NOT NULL,
APP_DATA_REGISTRAZIONE DATE NOT NULL,
APP_UTE_REGISTRAZIONE NUMBER(10) NOT NULL,
APP_APP_NUMERO NUMBER(5),
APP_ACC_NUMERO NUMBER(8),
APP_TIPO_AGENDA VARCHAR2(1 BYTE),
APP_FASCIA_CUP VARCHAR2(8 BYTE),
APP_DATA_SPOSTAMENTO DATE,
APP_UTE_SPOSTAMENTO NUMBER(10),
APP_DATA_REVOCA DATE,
APP_UTE_REVOCA NUMBER(10),
APP_NOTE VARCHAR2(4000 BYTE),
APP_CODICE NUMBER(8),
APP_AZI_CODICE VARCHAR2(10 BYTE) DEFAULT '080112' NOT NULL,
APP_DATA_ORA_ARROT DATE
);
ALTER TABLE ONHOSPITAL.T_AMB_APPUNTAMENTI ADD (
CONSTRAINT T_AMB_APPUNTAMENTI_PK
PRIMARY KEY
(APP_NUMERO, APP_RIC_CODICE, APP_AZI_CODICE);
And the script for the detail table T_AMB_APP_PRESTAZIONI is:
CREATE TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI
(
TAP_APP_NUMERO NUMBER(5) NOT NULL,
TAP_PRE_CODICE NUMBER(5) NOT NULL,
TAP_PRF_CODICE NUMBER(5),
TAP_AZI_CODICE VARCHAR2(10 BYTE) DEFAULT '080112' NOT NULL,
TAP_APP_RIC_CODICE VARCHAR2(12 BYTE) NOT NULL,
TAP_UNIERO_DEFAULT VARCHAR2(1 BYTE)
);
ALTER TABLE ONHOSPITAL.T_AMB_APP_PRESTAZIONI ADD (
CONSTRAINT T_AMB_APP_PRESTAZIONI_PK
PRIMARY KEY
(TAP_APP_NUMERO, TAP_PRE_CODICE, TAP_AZI_CODICE, TAP_APP_RIC_CODICE);
With version 4.75.43.0, I was able to generate edmx without any problem.
So I can't migrate to new version
- Mon 20 Oct 2008 16:48
- Forum: dotConnect for Oracle
- Topic: Entity Framework schema name
- Replies: 1
- Views: 2430
Entity Framework schema name
I have a large database schema (about 200 table). I've generated a library wich include the entity data model and the views for performance reasons. The Oracle database schema name where I generated edm and views is schema1 and I've a lot of customer where the schema name is not equal to schema1. The csdl, msl and ssdl file are not emedded in the library.
When I run a query for one of this customer with a different schema name I got the error "ORA-942 table or view does not exist". I captured the query with DbMonitor and I saw that in left outher join clause Corelab driver include the schema name schema1 even if I changed the .ssdl file used by the library (Schema="SCHEMA1" -> Schema="CUSTOMER_SCHEMA").
Where is stored the database schema information? How can I change it depending to the installation?
Thanks
When I run a query for one of this customer with a different schema name I got the error "ORA-942 table or view does not exist". I captured the query with DbMonitor and I saw that in left outher join clause Corelab driver include the schema name schema1 even if I changed the .ssdl file used by the library (Schema="SCHEMA1" -> Schema="CUSTOMER_SCHEMA").
Where is stored the database schema information? How can I change it depending to the installation?
Thanks