Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] too long comment
[Teneo] too long comment [message #91025] Fri, 20 July 2007 08:13 Go to next message
Roman Bliznets is currently offline Roman BliznetsFriend
Messages: 75
Registered: July 2009
Member
Unsuccessful: create table Too long comment for table

How I can disable comment?
Re: [Teneo] too long comment [message #91040 is a reply to message #91025] Fri, 20 July 2007 08:25 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Comments are new so therefor it now appears. There is no option for that (yet). Can you enter a
bugzilla for this?

For now if the comment is a primitive field then you have to subclass
BasicMapper and override this method:
protected Element addCommentElement(EModelElement eModelElement, Element hbmElement) {

and just return null.

You can set your BasicMapper as an Extension.

If the long comment is in a onetomany then the OneToManyMapper has to be extended etc.

Btw, I tested your case before this last release and it worked on mysql.

For my interest how large is the length constraint for the comment?

gr. Martin

wolf_roma wrote:
> Unsuccessful: create table Too long comment for table
>
> How I can disable comment?
>
>



--

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] too long comment [message #91054 is a reply to message #91040] Fri, 20 July 2007 09:32 Go to previous messageGo to next message
Roman Bliznets is currently offline Roman BliznetsFriend
Messages: 75
Registered: July 2009
Member
> For my interest how large is the length constraint for the comment?

A comment for a column can be specified with the COMMENT option, up to 255
characters long. (http://dev.mysql.com/doc/refman/5.0/en/create-table.html)

in bugzila:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=197273
Re: [Teneo] too long comment [message #91064 is a reply to message #91054] Fri, 20 July 2007 09:42 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Okay, I was not aware that there was even a comment length constraint in a db. I will probably add a
comment_max_length option which has default value 0 (=no comment as a default). As comments
apparently can result in low level db errors I prefer to disable it as a default.

gr. Martin

wolf_roma wrote:
>> For my interest how large is the length constraint for the comment?
>
> A comment for a column can be specified with the COMMENT option, up to 255
> characters long. (http://dev.mysql.com/doc/refman/5.0/en/create-table.html)
>
> in bugzila:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=197273
>
>
>


--

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] too long comment [message #91095 is a reply to message #91054] Fri, 20 July 2007 09:54 Go to previous messageGo to next message
Roman Bliznets is currently offline Roman BliznetsFriend
Messages: 75
Registered: July 2009
Member
I did all what you say, where mistakes?:
......
final ExtensionManager extensionManager = hds.getExtensionManager();
extensionManager.registerExtension(BasicMapper.class.getName (),
BasicMapperEx.class.getName());
extensionManager.registerExtension(OneToManyMapper.class.get Name(),
OneToManyMapperEx.class.getName());
hds.initialize();
......
public class BasicMapperEx extends BasicMapper{

/* (non-Javadoc)
* @see
org.eclipse.emf.teneo.hibernate.mapper.AbstractMapper#addCom mentElement(org.eclipse.emf.ecore.EModelElement,
org.eclipse.emf.teneo.simpledom.Element)
*/
@Override
protected Element addCommentElement(EModelElement modelElement,
Element hbmElement)
{
return null;
}
}
.....
public class OneToManyMapperEx extends OneToManyMapper{
/* (non-Javadoc)
* @see
org.eclipse.emf.teneo.hibernate.mapper.AbstractMapper#addCom mentElement(org.eclipse.emf.ecore.EModelElement,
org.eclipse.emf.teneo.simpledom.Element)
*/
@Override
protected Element addCommentElement(EModelElement modelElement,
Element hbmElement)
{
return null;
}
}

I have comment and haven't table )))
Re: [Teneo] too long comment [message #91110 is a reply to message #91095] Fri, 20 July 2007 10:01 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
If the comment is on a many-to-one you also have to override the ManyToOneMapper, the same for
ManyToMany.
In the future I will move these utility methods to a separate utility class which can be replaced by
itself. That's easier than overriding all these subclasses.

gr. Martin

wolf_roma wrote:
> I did all what you say, where mistakes?:
> ......
> final ExtensionManager extensionManager = hds.getExtensionManager();
> extensionManager.registerExtension(BasicMapper.class.getName (),
> BasicMapperEx.class.getName());
> extensionManager.registerExtension(OneToManyMapper.class.get Name(),
> OneToManyMapperEx.class.getName());
> hds.initialize();
> ......
> public class BasicMapperEx extends BasicMapper{
>
> /* (non-Javadoc)
> * @see
> org.eclipse.emf.teneo.hibernate.mapper.AbstractMapper#addCom mentElement(org.eclipse.emf.ecore.EModelElement,
> org.eclipse.emf.teneo.simpledom.Element)
> */
> @Override
> protected Element addCommentElement(EModelElement modelElement,
> Element hbmElement)
> {
> return null;
> }
> }
> .....
> public class OneToManyMapperEx extends OneToManyMapper{
> /* (non-Javadoc)
> * @see
> org.eclipse.emf.teneo.hibernate.mapper.AbstractMapper#addCom mentElement(org.eclipse.emf.ecore.EModelElement,
> org.eclipse.emf.teneo.simpledom.Element)
> */
> @Override
> protected Element addCommentElement(EModelElement modelElement,
> Element hbmElement)
> {
> return null;
> }
> }
>
> I have comment and haven't table )))
>
>


--

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] too long comment [message #91125 is a reply to message #91110] Fri, 20 July 2007 10:17 Go to previous message
Roman Bliznets is currently offline Roman BliznetsFriend
Messages: 75
Registered: July 2009
Member
:) I did what you say:

extensionManager.registerExtension(BasicMapper.class.getName (),
BasicMapperEx.class.getName());
extensionManager.registerExtension(OneToManyMapper.class.get Name(),
OneToManyMapperEx.class.getName());
extensionManager.registerExtension(ManyToOneMapper.class.get Name(),
ManyToOneMapperEx.class.getName());
extensionManager.registerExtension(ManyToManyMapper.class.ge tName(),
ManyToManyMapperEx.class.getName());

I check, extension work (return null from function)..

....

27563 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful:
create table `cstmconditiondocmentstype` (`documentbasetype_e_id` bigint not
null, `linenumber` numeric(2,2), `sublinenumber` varchar(2),
`documentmodecode` varchar(4), `informationcode` varchar(2), `perioddate`
date not null, `conditiondate` date, `saledate` date, `presentingdate` date,
`goodsstatus` varchar(1), `repairstatus` bit, primary key
(`documentbasetype_e_id`)) comment='???????? ? ??????????, ??????????? ? ?.
9.1 -9.6 ?? ??????????? ???????, ????? ??? ???????????? ? ???????? ?????????
?? ??????????? ???????.'

27563 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Too long
comment for table 'cstmconditiondocmentstype'

....
Re: [Teneo] too long comment [message #91140 is a reply to message #91125] Fri, 20 July 2007 10:17 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
And there is EntityMapper, IdMapper and ManyAttributeMapper. I think it is the EntityMapper as the
error seems to be on the table name.
Hmmm, I see now that your first post already mentioned this, I should have looked better...

gr. Martin

wolf_roma wrote:
> :) I did what you say:
>
> extensionManager.registerExtension(BasicMapper.class.getName (),
> BasicMapperEx.class.getName());
> extensionManager.registerExtension(OneToManyMapper.class.get Name(),
> OneToManyMapperEx.class.getName());
> extensionManager.registerExtension(ManyToOneMapper.class.get Name(),
> ManyToOneMapperEx.class.getName());
> extensionManager.registerExtension(ManyToManyMapper.class.ge tName(),
> ManyToManyMapperEx.class.getName());
>
> I check, extension work (return null from function)..
>
> ....
>
> 27563 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful:
> create table `cstmconditiondocmentstype` (`documentbasetype_e_id` bigint not
> null, `linenumber` numeric(2,2), `sublinenumber` varchar(2),
> `documentmodecode` varchar(4), `informationcode` varchar(2), `perioddate`
> date not null, `conditiondate` date, `saledate` date, `presentingdate` date,
> `goodsstatus` varchar(1), `repairstatus` bit, primary key
> (`documentbasetype_e_id`)) comment='???????? ? ??????????, ??????????? ? ?.
> 9.1 -9.6 ?? ??????????? ???????, ????? ??? ???????????? ? ???????? ?????????
> ?? ??????????? ???????.'
>
> 27563 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Too long
> comment for table 'cstmconditiondocmentstype'
>
> ....
>
>
>
>
>


--

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] too long comment [message #608829 is a reply to message #91025] Fri, 20 July 2007 08:25 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Comments are new so therefor it now appears. There is no option for that (yet). Can you enter a
bugzilla for this?

For now if the comment is a primitive field then you have to subclass
BasicMapper and override this method:
protected Element addCommentElement(EModelElement eModelElement, Element hbmElement) {

and just return null.

You can set your BasicMapper as an Extension.

If the long comment is in a onetomany then the OneToManyMapper has to be extended etc.

Btw, I tested your case before this last release and it worked on mysql.

For my interest how large is the length constraint for the comment?

gr. Martin

wolf_roma wrote:
> Unsuccessful: create table Too long comment for table
>
> How I can disable comment?
>
>



--

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] too long comment [message #608830 is a reply to message #91040] Fri, 20 July 2007 09:32 Go to previous message
Roman Bliznets is currently offline Roman BliznetsFriend
Messages: 75
Registered: July 2009
Member
> For my interest how large is the length constraint for the comment?

A comment for a column can be specified with the COMMENT option, up to 255
characters long. (http://dev.mysql.com/doc/refman/5.0/en/create-table.html)

in bugzila:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=197273
Re: [Teneo] too long comment [message #608831 is a reply to message #91054] Fri, 20 July 2007 09:42 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Okay, I was not aware that there was even a comment length constraint in a db. I will probably add a
comment_max_length option which has default value 0 (=no comment as a default). As comments
apparently can result in low level db errors I prefer to disable it as a default.

gr. Martin

wolf_roma wrote:
>> For my interest how large is the length constraint for the comment?
>
> A comment for a column can be specified with the COMMENT option, up to 255
> characters long. (http://dev.mysql.com/doc/refman/5.0/en/create-table.html)
>
> in bugzila:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=197273
>
>
>


--

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] too long comment [message #608833 is a reply to message #91054] Fri, 20 July 2007 09:54 Go to previous message
Roman Bliznets is currently offline Roman BliznetsFriend
Messages: 75
Registered: July 2009
Member
I did all what you say, where mistakes?:
......
final ExtensionManager extensionManager = hds.getExtensionManager();
extensionManager.registerExtension(BasicMapper.class.getName (),
BasicMapperEx.class.getName());
extensionManager.registerExtension(OneToManyMapper.class.get Name(),
OneToManyMapperEx.class.getName());
hds.initialize();
......
public class BasicMapperEx extends BasicMapper{

/* (non-Javadoc)
* @see
org.eclipse.emf.teneo.hibernate.mapper.AbstractMapper#addCom mentElement(org.eclipse.emf.ecore.EModelElement,
org.eclipse.emf.teneo.simpledom.Element)
*/
@Override
protected Element addCommentElement(EModelElement modelElement,
Element hbmElement)
{
return null;
}
}
.....
public class OneToManyMapperEx extends OneToManyMapper{
/* (non-Javadoc)
* @see
org.eclipse.emf.teneo.hibernate.mapper.AbstractMapper#addCom mentElement(org.eclipse.emf.ecore.EModelElement,
org.eclipse.emf.teneo.simpledom.Element)
*/
@Override
protected Element addCommentElement(EModelElement modelElement,
Element hbmElement)
{
return null;
}
}

I have comment and haven't table )))
Re: [Teneo] too long comment [message #608834 is a reply to message #91095] Fri, 20 July 2007 10:01 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
If the comment is on a many-to-one you also have to override the ManyToOneMapper, the same for
ManyToMany.
In the future I will move these utility methods to a separate utility class which can be replaced by
itself. That's easier than overriding all these subclasses.

gr. Martin

wolf_roma wrote:
> I did all what you say, where mistakes?:
> ......
> final ExtensionManager extensionManager = hds.getExtensionManager();
> extensionManager.registerExtension(BasicMapper.class.getName (),
> BasicMapperEx.class.getName());
> extensionManager.registerExtension(OneToManyMapper.class.get Name(),
> OneToManyMapperEx.class.getName());
> hds.initialize();
> ......
> public class BasicMapperEx extends BasicMapper{
>
> /* (non-Javadoc)
> * @see
> org.eclipse.emf.teneo.hibernate.mapper.AbstractMapper#addCom mentElement(org.eclipse.emf.ecore.EModelElement,
> org.eclipse.emf.teneo.simpledom.Element)
> */
> @Override
> protected Element addCommentElement(EModelElement modelElement,
> Element hbmElement)
> {
> return null;
> }
> }
> .....
> public class OneToManyMapperEx extends OneToManyMapper{
> /* (non-Javadoc)
> * @see
> org.eclipse.emf.teneo.hibernate.mapper.AbstractMapper#addCom mentElement(org.eclipse.emf.ecore.EModelElement,
> org.eclipse.emf.teneo.simpledom.Element)
> */
> @Override
> protected Element addCommentElement(EModelElement modelElement,
> Element hbmElement)
> {
> return null;
> }
> }
>
> I have comment and haven't table )))
>
>


--

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] too long comment [message #608835 is a reply to message #91110] Fri, 20 July 2007 10:17 Go to previous message
Roman Bliznets is currently offline Roman BliznetsFriend
Messages: 75
Registered: July 2009
Member
:) I did what you say:

extensionManager.registerExtension(BasicMapper.class.getName (),
BasicMapperEx.class.getName());
extensionManager.registerExtension(OneToManyMapper.class.get Name(),
OneToManyMapperEx.class.getName());
extensionManager.registerExtension(ManyToOneMapper.class.get Name(),
ManyToOneMapperEx.class.getName());
extensionManager.registerExtension(ManyToManyMapper.class.ge tName(),
ManyToManyMapperEx.class.getName());

I check, extension work (return null from function)..

....

27563 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful:
create table `cstmconditiondocmentstype` (`documentbasetype_e_id` bigint not
null, `linenumber` numeric(2,2), `sublinenumber` varchar(2),
`documentmodecode` varchar(4), `informationcode` varchar(2), `perioddate`
date not null, `conditiondate` date, `saledate` date, `presentingdate` date,
`goodsstatus` varchar(1), `repairstatus` bit, primary key
(`documentbasetype_e_id`)) comment='???????? ? ??????????, ??????????? ? ?.
9.1 -9.6 ?? ??????????? ???????, ????? ??? ???????????? ? ???????? ?????????
?? ??????????? ???????.'

27563 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Too long
comment for table 'cstmconditiondocmentstype'

....
Re: [Teneo] too long comment [message #608836 is a reply to message #91125] Fri, 20 July 2007 10:17 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
And there is EntityMapper, IdMapper and ManyAttributeMapper. I think it is the EntityMapper as the
error seems to be on the table name.
Hmmm, I see now that your first post already mentioned this, I should have looked better...

gr. Martin

wolf_roma wrote:
> :) I did what you say:
>
> extensionManager.registerExtension(BasicMapper.class.getName (),
> BasicMapperEx.class.getName());
> extensionManager.registerExtension(OneToManyMapper.class.get Name(),
> OneToManyMapperEx.class.getName());
> extensionManager.registerExtension(ManyToOneMapper.class.get Name(),
> ManyToOneMapperEx.class.getName());
> extensionManager.registerExtension(ManyToManyMapper.class.ge tName(),
> ManyToManyMapperEx.class.getName());
>
> I check, extension work (return null from function)..
>
> ....
>
> 27563 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful:
> create table `cstmconditiondocmentstype` (`documentbasetype_e_id` bigint not
> null, `linenumber` numeric(2,2), `sublinenumber` varchar(2),
> `documentmodecode` varchar(4), `informationcode` varchar(2), `perioddate`
> date not null, `conditiondate` date, `saledate` date, `presentingdate` date,
> `goodsstatus` varchar(1), `repairstatus` bit, primary key
> (`documentbasetype_e_id`)) comment='???????? ? ??????????, ??????????? ? ?.
> 9.1 -9.6 ?? ??????????? ???????, ????? ??? ???????????? ? ???????? ?????????
> ?? ??????????? ???????.'
>
> 27563 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Too long
> comment for table 'cstmconditiondocmentstype'
>
> ....
>
>
>
>
>


--

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
Previous Topic:Latest build Teneo, backward compatibility
Next Topic:[EMF Compare] StructureViewer and LabelProvider
Goto Forum:
  


Current Time: Sat Aug 13 00:50:44 GMT 2022

Powered by FUDForum. Page generated in 0.04076 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top