Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [Teneo+hibernate]
[Teneo+hibernate] [message #81661] |
Wed, 02 May 2007 03:36  |
Eclipse User |
|
|
|
Hello.
I'm use emf 2.3.0.v200703291501, teneo 0.8.0.v200704230019, hibernate 3.2,
database MySQL.
I convert XSD into Ecore model. After
Teneo maps Ecore into database wrong.
Wrong column types.
First Problem:
in XSD:
<xs:simpleType name="Count2Type">
<xs:annotation>
<xs:documentation>Number. form 1. to 2 digit. </xs:documentation>
</xs:annotation>
<xs:restriction base="CategoryCust:IntegerCategoriesCust">
<xs:totalDigits value="2"/>
<xs:minInclusive value="1"/>
</xs:restriction>
</xs:simpleType>
in DataBase type of column: DECIMAL(2,2) (should be DECIMAL(2,0))
I take xml mapping (hbds.getMappingXML();) from datastore
---
<property name="subLineNumber" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.math.BigInteger">
<column not-null="false" unique="false" name="`sublinenumber`"
precision="2"/>
</property>
---
Second Problem:
in XSD:
<xs:simpleType name="Code2Type">
<xs:annotation>
<xs:documentation>Code. 2 symbols</xs:documentation>
</xs:annotation>
<xs:restriction base="CategoryCust:CodeCategoriesCust">
<xs:length value="2"/>
</xs:restriction>
</xs:simpleType>
in DataBase type of column: varchar(1) (should be varchar(2)) but not for
every column;
in xml mapping:
---
<property name="goodsStatus" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`goodsstatus`"
length="2"/>
</property>
---
Where is problem in Teneo or Hibernate?
P.S All types in Ecore equal to all types in XSD.
|
|
|
Re: [Teneo+hibernate] [message #81676 is a reply to message #81661] |
Wed, 02 May 2007 03:52   |
Eclipse User |
|
|
|
Hi,
It seems that the problem is in Hibernate. Possibly the mapping logic of Teneo can be adapted to
give hibernate the right hints.
Can you try with log4j set to debugging? Then you can see how hibernate creates the tables in the
beginning, maybe this gives some more information.
You can manually change the mapping and see what works for you. If you post the updated mapping then
I can see how to adapt the mapping logic.
gr. Martin
wolf_roma wrote:
> Hello.
> I'm use emf 2.3.0.v200703291501, teneo 0.8.0.v200704230019, hibernate 3.2,
> database MySQL.
> I convert XSD into Ecore model. After
> Teneo maps Ecore into database wrong.
>
> Wrong column types.
>
> First Problem:
> in XSD:
> <xs:simpleType name="Count2Type">
> <xs:annotation>
> <xs:documentation>Number. form 1. to 2 digit. </xs:documentation>
> </xs:annotation>
> <xs:restriction base="CategoryCust:IntegerCategoriesCust">
> <xs:totalDigits value="2"/>
> <xs:minInclusive value="1"/>
> </xs:restriction>
> </xs:simpleType>
> in DataBase type of column: DECIMAL(2,2) (should be DECIMAL(2,0))
> I take xml mapping (hbds.getMappingXML();) from datastore
> ---
> <property name="subLineNumber" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.math.BigInteger">
> <column not-null="false" unique="false" name="`sublinenumber`"
> precision="2"/>
> </property>
> ---
>
> Second Problem:
> in XSD:
> <xs:simpleType name="Code2Type">
> <xs:annotation>
> <xs:documentation>Code. 2 symbols</xs:documentation>
> </xs:annotation>
> <xs:restriction base="CategoryCust:CodeCategoriesCust">
> <xs:length value="2"/>
> </xs:restriction>
> </xs:simpleType>
> in DataBase type of column: varchar(1) (should be varchar(2)) but not for
> every column;
> in xml mapping:
> ---
> <property name="goodsStatus" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`goodsstatus`"
> length="2"/>
> </property>
> ---
>
> Where is problem in Teneo or Hibernate?
> P.S All types in Ecore equal to all types in XSD.
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo+hibernate] [message #81690 is a reply to message #81676] |
Wed, 02 May 2007 04:53   |
Eclipse User |
|
|
|
Ok, I set Log4j in debug mode;
First problem:
It solved if I manual add attribute: scale="0";
Second Problem:
in xml mapping:
<property name="goodsStatus" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`goodsstatus`" length="2"/>
</property>
<property name="repairStatus" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`repairstatus`"
length="2"/>
</property>
from log:
5157 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table
`documentbasetype` (e_id bigint not null auto_increment, `dtype`
varchar(255) not null, e_version integer not null, `prdocumentname`
varchar(250), `prdocumentnumber` varchar(50), `prdocumentdate` varchar(255),
`complationauthoritydate` varchar(255), `linenumber` numeric(2,0),
`sublinenumber` varchar(2), `documentmodecode` varchar(4), `informationcode`
varchar(2), `perioddate` varchar(255), `conditiondate` varchar(255),
`saledate` varchar(255), `presentingdate` varchar(255), `goodsstatus`
varchar(1), `repairstatus` bit, `documentbeginactionsdat` varchar(255),
`documentendactionsdate` varchar(255), `organizationname` varchar(150),
`presentinglackingdate` varchar(255), `presenteddocumentmodecode`
varchar(4), `actnumber` varchar(50), `actdate` varchar(255),
`privelegedocumentmodecode` varchar(2), `excisemarkingmodecodetype`
varchar(1), `customspaymentmodecodetyp` varchar(2), `symbolsublinenumber`
varchar(1), `supplystatus` varchar(2), `exportdate` varchar(255),
`esadoutpresenteddocume_id` bigint, `esadoutpresenteddocum_idx` integer,
`esadcontractlisttype_a_id` bigint, `esadcontractlisttype__idx` integer,
econtainer_class varchar(255), e_container varchar(255),
e_container_featureid integer, primary key (e_id))
`goodsstatus` varchar(1) - should be varchar(2)
`repairstatus` bit - it big wrong :), should be varchar(2)
Another fields right;
May be I have to use definite Hibernate?
Can I take Teneo mapping and use it without Teneo? (How to do?)
Should I post in Hibernate.org about the bug?
you wrote:
> Hi,
> It seems that the problem is in Hibernate. Possibly the mapping logic of
> Teneo can be adapted to give hibernate the right hints.
> Can you try with log4j set to debugging? Then you can see how hibernate
> creates the tables in the beginning, maybe this gives some more
> information.
>
> You can manually change the mapping and see what works for you. If you
> post the updated mapping then I can see how to adapt the mapping logic.
>
> gr. Martin
>
|
|
|
Re: [Teneo+hibernate] [message #81705 is a reply to message #81690] |
Wed, 02 May 2007 05:05   |
Eclipse User |
|
|
|
The repairstatus is even more strange, is there by accident another eclass which also has a
repairstatus which is of another type (boolean)?
You can use the hbm in combination with Teneo. In this case Teneo will not do any automatic mapping
but will use the hbm file. See the option: PersistenceOptions.USE_MAPPING_FILE, here:
http://www.elver.org/hibernate/options.html
I would upgrade to the latest version of hibernate. Although I would surprised if that is the issue
here.
Can you try a join table mapping strategy? See the option:
PersistenceOptions.INHERITANCE_MAPPING
gr. Martin
wolf_roma wrote:
> Ok, I set Log4j in debug mode;
> First problem:
> It solved if I manual add attribute: scale="0";
>
> Second Problem:
> in xml mapping:
> <property name="goodsStatus" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`goodsstatus`" length="2"/>
> </property>
> <property name="repairStatus" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`repairstatus`"
> length="2"/>
> </property>
>
> from log:
> 5157 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table
> `documentbasetype` (e_id bigint not null auto_increment, `dtype`
> varchar(255) not null, e_version integer not null, `prdocumentname`
> varchar(250), `prdocumentnumber` varchar(50), `prdocumentdate` varchar(255),
> `complationauthoritydate` varchar(255), `linenumber` numeric(2,0),
> `sublinenumber` varchar(2), `documentmodecode` varchar(4), `informationcode`
> varchar(2), `perioddate` varchar(255), `conditiondate` varchar(255),
> `saledate` varchar(255), `presentingdate` varchar(255), `goodsstatus`
> varchar(1), `repairstatus` bit, `documentbeginactionsdat` varchar(255),
> `documentendactionsdate` varchar(255), `organizationname` varchar(150),
> `presentinglackingdate` varchar(255), `presenteddocumentmodecode`
> varchar(4), `actnumber` varchar(50), `actdate` varchar(255),
> `privelegedocumentmodecode` varchar(2), `excisemarkingmodecodetype`
> varchar(1), `customspaymentmodecodetyp` varchar(2), `symbolsublinenumber`
> varchar(1), `supplystatus` varchar(2), `exportdate` varchar(255),
> `esadoutpresenteddocume_id` bigint, `esadoutpresenteddocum_idx` integer,
> `esadcontractlisttype_a_id` bigint, `esadcontractlisttype__idx` integer,
> econtainer_class varchar(255), e_container varchar(255),
> e_container_featureid integer, primary key (e_id))
>
> `goodsstatus` varchar(1) - should be varchar(2)
> `repairstatus` bit - it big wrong :), should be varchar(2)
> Another fields right;
>
> May be I have to use definite Hibernate?
> Can I take Teneo mapping and use it without Teneo? (How to do?)
> Should I post in Hibernate.org about the bug?
>
> you wrote:
>> Hi,
>> It seems that the problem is in Hibernate. Possibly the mapping logic of
>> Teneo can be adapted to give hibernate the right hints.
>> Can you try with log4j set to debugging? Then you can see how hibernate
>> creates the tables in the beginning, maybe this gives some more
>> information.
>>
>> You can manually change the mapping and see what works for you. If you
>> post the updated mapping then I can see how to adapt the mapping logic.
>>
>> gr. Martin
>>
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo+hibernate] [message #81766 is a reply to message #81705] |
Wed, 02 May 2007 11:06   |
Eclipse User |
|
|
|
I'm try to use PersistenceOptions.INHERITANCE_MAPPING and it solve my
problem with columnb types; (Same parent class has two children class with
identical filednames.)
I have another problem:
Hibernate: insert into goodsDescription (`processinggoodstype_go_id`,
`processinggoodstype_g_idx`, elt) values (?, ?, ?)
10781 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error:
1364, SQLState: HY000
10781 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Field
'goodsitembasetype_good_id' doesn't have a default value
List of varchar(250) (goodsDescription) is used in some comlex types;
In sql:
create table goodsDescription (
`goodsitembasetype_good_id` bigint not null,
elt varchar(255),
`goodsitembasetype_goo_idx` integer not null,
`goodsbasetype_goodsdes_id` bigint not null,
`goodsbasetype_goodsde_idx` integer not null,
`goodsgroupdescriptiont_id` bigint not null,
`goodsgroupdescription_idx` integer not null,
`processinggoodstype_go_id` bigint not null,
`processinggoodstype_g_idx` integer not null,
primary key (`processinggoodstype_go_id`,
`processinggoodstype_g_idx`)
)
What me to do?
Most probably that this is Hibernate mistake, but
I don't understand how fix it...
May be i send you my project?
|
|
|
Re: [Teneo+hibernate] [message #81780 is a reply to message #81766] |
Wed, 02 May 2007 11:15   |
Eclipse User |
|
|
|
Can you just send me the ecore and the hbm files? This should be enough for me to look at.
gr. Martin
wolf_roma wrote:
> I'm try to use PersistenceOptions.INHERITANCE_MAPPING and it solve my
> problem with columnb types; (Same parent class has two children class with
> identical filednames.)
>
> I have another problem:
> Hibernate: insert into goodsDescription (`processinggoodstype_go_id`,
> `processinggoodstype_g_idx`, elt) values (?, ?, ?)
> 10781 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error:
> 1364, SQLState: HY000
> 10781 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Field
> 'goodsitembasetype_good_id' doesn't have a default value
>
> List of varchar(250) (goodsDescription) is used in some comlex types;
>
> In sql:
> create table goodsDescription (
> `goodsitembasetype_good_id` bigint not null,
> elt varchar(255),
> `goodsitembasetype_goo_idx` integer not null,
> `goodsbasetype_goodsdes_id` bigint not null,
> `goodsbasetype_goodsde_idx` integer not null,
> `goodsgroupdescriptiont_id` bigint not null,
> `goodsgroupdescription_idx` integer not null,
> `processinggoodstype_go_id` bigint not null,
> `processinggoodstype_g_idx` integer not null,
> primary key (`processinggoodstype_go_id`,
> `processinggoodstype_g_idx`)
> )
>
>
> What me to do?
> Most probably that this is Hibernate mistake, but
> I don't understand how fix it...
>
> May be i send you my project?
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
| | | | | |
Re: [Teneo+hibernate] [message #605185 is a reply to message #81661] |
Wed, 02 May 2007 03:52  |
Eclipse User |
|
|
|
Hi,
It seems that the problem is in Hibernate. Possibly the mapping logic of Teneo can be adapted to
give hibernate the right hints.
Can you try with log4j set to debugging? Then you can see how hibernate creates the tables in the
beginning, maybe this gives some more information.
You can manually change the mapping and see what works for you. If you post the updated mapping then
I can see how to adapt the mapping logic.
gr. Martin
wolf_roma wrote:
> Hello.
> I'm use emf 2.3.0.v200703291501, teneo 0.8.0.v200704230019, hibernate 3.2,
> database MySQL.
> I convert XSD into Ecore model. After
> Teneo maps Ecore into database wrong.
>
> Wrong column types.
>
> First Problem:
> in XSD:
> <xs:simpleType name="Count2Type">
> <xs:annotation>
> <xs:documentation>Number. form 1. to 2 digit. </xs:documentation>
> </xs:annotation>
> <xs:restriction base="CategoryCust:IntegerCategoriesCust">
> <xs:totalDigits value="2"/>
> <xs:minInclusive value="1"/>
> </xs:restriction>
> </xs:simpleType>
> in DataBase type of column: DECIMAL(2,2) (should be DECIMAL(2,0))
> I take xml mapping (hbds.getMappingXML();) from datastore
> ---
> <property name="subLineNumber" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.math.BigInteger">
> <column not-null="false" unique="false" name="`sublinenumber`"
> precision="2"/>
> </property>
> ---
>
> Second Problem:
> in XSD:
> <xs:simpleType name="Code2Type">
> <xs:annotation>
> <xs:documentation>Code. 2 symbols</xs:documentation>
> </xs:annotation>
> <xs:restriction base="CategoryCust:CodeCategoriesCust">
> <xs:length value="2"/>
> </xs:restriction>
> </xs:simpleType>
> in DataBase type of column: varchar(1) (should be varchar(2)) but not for
> every column;
> in xml mapping:
> ---
> <property name="goodsStatus" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`goodsstatus`"
> length="2"/>
> </property>
> ---
>
> Where is problem in Teneo or Hibernate?
> P.S All types in Ecore equal to all types in XSD.
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo+hibernate] [message #605189 is a reply to message #81676] |
Wed, 02 May 2007 04:53  |
Eclipse User |
|
|
|
Ok, I set Log4j in debug mode;
First problem:
It solved if I manual add attribute: scale="0";
Second Problem:
in xml mapping:
<property name="goodsStatus" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`goodsstatus`" length="2"/>
</property>
<property name="repairStatus" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`repairstatus`"
length="2"/>
</property>
from log:
5157 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table
`documentbasetype` (e_id bigint not null auto_increment, `dtype`
varchar(255) not null, e_version integer not null, `prdocumentname`
varchar(250), `prdocumentnumber` varchar(50), `prdocumentdate` varchar(255),
`complationauthoritydate` varchar(255), `linenumber` numeric(2,0),
`sublinenumber` varchar(2), `documentmodecode` varchar(4), `informationcode`
varchar(2), `perioddate` varchar(255), `conditiondate` varchar(255),
`saledate` varchar(255), `presentingdate` varchar(255), `goodsstatus`
varchar(1), `repairstatus` bit, `documentbeginactionsdat` varchar(255),
`documentendactionsdate` varchar(255), `organizationname` varchar(150),
`presentinglackingdate` varchar(255), `presenteddocumentmodecode`
varchar(4), `actnumber` varchar(50), `actdate` varchar(255),
`privelegedocumentmodecode` varchar(2), `excisemarkingmodecodetype`
varchar(1), `customspaymentmodecodetyp` varchar(2), `symbolsublinenumber`
varchar(1), `supplystatus` varchar(2), `exportdate` varchar(255),
`esadoutpresenteddocume_id` bigint, `esadoutpresenteddocum_idx` integer,
`esadcontractlisttype_a_id` bigint, `esadcontractlisttype__idx` integer,
econtainer_class varchar(255), e_container varchar(255),
e_container_featureid integer, primary key (e_id))
`goodsstatus` varchar(1) - should be varchar(2)
`repairstatus` bit - it big wrong :), should be varchar(2)
Another fields right;
May be I have to use definite Hibernate?
Can I take Teneo mapping and use it without Teneo? (How to do?)
Should I post in Hibernate.org about the bug?
you wrote:
> Hi,
> It seems that the problem is in Hibernate. Possibly the mapping logic of
> Teneo can be adapted to give hibernate the right hints.
> Can you try with log4j set to debugging? Then you can see how hibernate
> creates the tables in the beginning, maybe this gives some more
> information.
>
> You can manually change the mapping and see what works for you. If you
> post the updated mapping then I can see how to adapt the mapping logic.
>
> gr. Martin
>
|
|
|
Re: [Teneo+hibernate] [message #605191 is a reply to message #81690] |
Wed, 02 May 2007 05:05  |
Eclipse User |
|
|
|
The repairstatus is even more strange, is there by accident another eclass which also has a
repairstatus which is of another type (boolean)?
You can use the hbm in combination with Teneo. In this case Teneo will not do any automatic mapping
but will use the hbm file. See the option: PersistenceOptions.USE_MAPPING_FILE, here:
http://www.elver.org/hibernate/options.html
I would upgrade to the latest version of hibernate. Although I would surprised if that is the issue
here.
Can you try a join table mapping strategy? See the option:
PersistenceOptions.INHERITANCE_MAPPING
gr. Martin
wolf_roma wrote:
> Ok, I set Log4j in debug mode;
> First problem:
> It solved if I manual add attribute: scale="0";
>
> Second Problem:
> in xml mapping:
> <property name="goodsStatus" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`goodsstatus`" length="2"/>
> </property>
> <property name="repairStatus" lazy="false" insert="true" update="true"
> not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`repairstatus`"
> length="2"/>
> </property>
>
> from log:
> 5157 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate - create table
> `documentbasetype` (e_id bigint not null auto_increment, `dtype`
> varchar(255) not null, e_version integer not null, `prdocumentname`
> varchar(250), `prdocumentnumber` varchar(50), `prdocumentdate` varchar(255),
> `complationauthoritydate` varchar(255), `linenumber` numeric(2,0),
> `sublinenumber` varchar(2), `documentmodecode` varchar(4), `informationcode`
> varchar(2), `perioddate` varchar(255), `conditiondate` varchar(255),
> `saledate` varchar(255), `presentingdate` varchar(255), `goodsstatus`
> varchar(1), `repairstatus` bit, `documentbeginactionsdat` varchar(255),
> `documentendactionsdate` varchar(255), `organizationname` varchar(150),
> `presentinglackingdate` varchar(255), `presenteddocumentmodecode`
> varchar(4), `actnumber` varchar(50), `actdate` varchar(255),
> `privelegedocumentmodecode` varchar(2), `excisemarkingmodecodetype`
> varchar(1), `customspaymentmodecodetyp` varchar(2), `symbolsublinenumber`
> varchar(1), `supplystatus` varchar(2), `exportdate` varchar(255),
> `esadoutpresenteddocume_id` bigint, `esadoutpresenteddocum_idx` integer,
> `esadcontractlisttype_a_id` bigint, `esadcontractlisttype__idx` integer,
> econtainer_class varchar(255), e_container varchar(255),
> e_container_featureid integer, primary key (e_id))
>
> `goodsstatus` varchar(1) - should be varchar(2)
> `repairstatus` bit - it big wrong :), should be varchar(2)
> Another fields right;
>
> May be I have to use definite Hibernate?
> Can I take Teneo mapping and use it without Teneo? (How to do?)
> Should I post in Hibernate.org about the bug?
>
> you wrote:
>> Hi,
>> It seems that the problem is in Hibernate. Possibly the mapping logic of
>> Teneo can be adapted to give hibernate the right hints.
>> Can you try with log4j set to debugging? Then you can see how hibernate
>> creates the tables in the beginning, maybe this gives some more
>> information.
>>
>> You can manually change the mapping and see what works for you. If you
>> post the updated mapping then I can see how to adapt the mapping logic.
>>
>> gr. Martin
>>
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo+hibernate] [message #605203 is a reply to message #81705] |
Wed, 02 May 2007 11:06  |
Eclipse User |
|
|
|
I'm try to use PersistenceOptions.INHERITANCE_MAPPING and it solve my
problem with columnb types; (Same parent class has two children class with
identical filednames.)
I have another problem:
Hibernate: insert into goodsDescription (`processinggoodstype_go_id`,
`processinggoodstype_g_idx`, elt) values (?, ?, ?)
10781 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error:
1364, SQLState: HY000
10781 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Field
'goodsitembasetype_good_id' doesn't have a default value
List of varchar(250) (goodsDescription) is used in some comlex types;
In sql:
create table goodsDescription (
`goodsitembasetype_good_id` bigint not null,
elt varchar(255),
`goodsitembasetype_goo_idx` integer not null,
`goodsbasetype_goodsdes_id` bigint not null,
`goodsbasetype_goodsde_idx` integer not null,
`goodsgroupdescriptiont_id` bigint not null,
`goodsgroupdescription_idx` integer not null,
`processinggoodstype_go_id` bigint not null,
`processinggoodstype_g_idx` integer not null,
primary key (`processinggoodstype_go_id`,
`processinggoodstype_g_idx`)
)
What me to do?
Most probably that this is Hibernate mistake, but
I don't understand how fix it...
May be i send you my project?
|
|
|
Re: [Teneo+hibernate] [message #605206 is a reply to message #81766] |
Wed, 02 May 2007 11:15  |
Eclipse User |
|
|
|
Can you just send me the ecore and the hbm files? This should be enough for me to look at.
gr. Martin
wolf_roma wrote:
> I'm try to use PersistenceOptions.INHERITANCE_MAPPING and it solve my
> problem with columnb types; (Same parent class has two children class with
> identical filednames.)
>
> I have another problem:
> Hibernate: insert into goodsDescription (`processinggoodstype_go_id`,
> `processinggoodstype_g_idx`, elt) values (?, ?, ?)
> 10781 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error:
> 1364, SQLState: HY000
> 10781 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Field
> 'goodsitembasetype_good_id' doesn't have a default value
>
> List of varchar(250) (goodsDescription) is used in some comlex types;
>
> In sql:
> create table goodsDescription (
> `goodsitembasetype_good_id` bigint not null,
> elt varchar(255),
> `goodsitembasetype_goo_idx` integer not null,
> `goodsbasetype_goodsdes_id` bigint not null,
> `goodsbasetype_goodsde_idx` integer not null,
> `goodsgroupdescriptiont_id` bigint not null,
> `goodsgroupdescription_idx` integer not null,
> `processinggoodstype_go_id` bigint not null,
> `processinggoodstype_g_idx` integer not null,
> primary key (`processinggoodstype_go_id`,
> `processinggoodstype_g_idx`)
> )
>
>
> What me to do?
> Most probably that this is Hibernate mistake, but
> I don't understand how fix it...
>
> May be i send you my project?
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
| |
Re: [Teneo+hibernate] [message #605219 is a reply to message #81796] |
Fri, 04 May 2007 02:23  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------020906080109030003060303
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
I checked and there are several types which use the same eattribute name for a many eattribute. This
results in one jointable called goodsDescription (which stores the values of the eattribute) which
is created/used for all these occurences. This is a missing feature of Teneo. Teneo should choose a
unique join table name (for one-to-many ereferences this is done, but not yet for many eattributes).
Can you enter a bugzilla for this?
This will be solved in the next release (which will be in a few weeks).
In the mean time you can set the join table name through annotations. This has to be done for each
occurence of the eattribute with a name-clash (and which has many=true). I attached an example xml
to do that for one for one eclass. This xml should be put in the source tree (classpath) and the
classpath location (incl. filename) should be passed to teneo using the
PersistenceOptions.PERSISTENCE_XML option. What you will see is that a jointable with name
'myuniquename' is created.
I checked and there are at least two other eattribute names which are being used by multiple
eclasses for a many-eattribute:
AutoMotoParametersType
ProcessingGoodsDeclarationType
but maybe there are more.
gr. Martin
wolf_roma wrote:
> Hello, Martin.
> Some description:
> xsdtest - Ecore model
> in xsdtest.test project:
> customs.ru.categories._3._0._0.tests._0Example - main class
> test.QuickStart - class which provides SessionFactory
> test.xml - input xml
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
--------------020906080109030003060303
Content-Type: text/xml;
name="test.persistence.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="test.persistence.xml"
<?xml version="1.0" encoding="utf-8"?>
<persistence-mapping xmlns="http://www.eclipse.org/emft/teneo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<epackage
namespace-uri="urn:customs.ru:ESADCommonAggregateTypes:3.0.1 ">
<eclass name="GoodsItemBaseType">
<property name="goodsDescription">
<join-table name="myuniquename"/>
</property>
</eclass>
</epackage>
</persistence-mapping>
--------------020906080109030003060303--
|
|
|
Re: [Teneo+hibernate] [message #605222 is a reply to message #81845] |
Fri, 04 May 2007 03:33  |
Eclipse User |
|
|
|
Thanks. I will be use PersistenceOptions.PERSISTENCE_XML before release next
Teneo version.
I see what you already create issue in bugzilla (183563), it dosn't?
|
|
|
Re: [Teneo+hibernate] [message #605226 is a reply to message #81860] |
Fri, 04 May 2007 03:52  |
Eclipse User |
|
|
|
Hi, no this is a different issue (although related) can you create a new bugzilla?
Can you also include a hyperlink to the newsgroup discussion then that would help others who see the
issue?
Thanks.
gr. Martin
wolf_roma wrote:
> Thanks. I will be use PersistenceOptions.PERSISTENCE_XML before release next
> Teneo version.
> I see what you already create issue in bugzilla (183563), it dosn't?
>
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
| |
Goto Forum:
Current Time: Mon Jul 07 10:27:02 EDT 2025
Powered by FUDForum. Page generated in 0.35862 seconds
|