Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] teneo.naming.sql_fk_name_prefix property ignored (The teneo property teneo.naming.sql_fk_name_prefix seems to be ignored in the ehb file)
[Teneo] teneo.naming.sql_fk_name_prefix property ignored [message #795741] Fri, 10 February 2012 22:03 Go to next message
Mark Geib is currently offline Mark GeibFriend
Messages: 432
Registered: July 2009
Senior Member
I am running current, updated as well, versions of Eclipse/EMF/Teneo/Hibernate and can not seem to get the property teneo.naming.sql_fk_name_prefix to be honored in my .ehb file.

Other properties are working, but not this one.

I am trying to resolve an issue where hibernate is trying to create a constraint/foreign key with the same name as a table.

Thanks,
Mark.
Re: [Teneo] teneo.naming.sql_fk_name_prefix property ignored [message #796122 is a reply to message #795741] Sat, 11 February 2012 12:37 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mark,
To be honest, it has been years since I tried an ehb file... But can you post it here, so I can check it?

gr. Martin

On 02/10/2012 11:03 PM, Mark Geib wrote:
> I am running current, updated as well, versions of Eclipse/EMF/Teneo/Hibernate and can not seem to get the property
> teneo.naming.sql_fk_name_prefix to be honored in my .ehb file.
>
> Other properties are working, but not this one.
>
> I am trying to resolve an issue where hibernate is trying to create a constraint/foreign key with the same name as a table.
>
> Thanks,
> Mark.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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] teneo.naming.sql_fk_name_prefix property ignored [message #796232 is a reply to message #796122] Sat, 11 February 2012 17:11 Go to previous messageGo to next message
Mark Geib is currently offline Mark GeibFriend
Messages: 432
Registered: July 2009
Senior Member
Martin,

See below. What do you recommend as the best practice to configure Teneo/Hibernate in the current version.?

Mark.

#
# Copyright 2005-2006, Elver.org (http://www.elver.org).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------
#

# Contains an example of the contents of an ehb file.

# name: the name under which this information is used to register a EMFDataStore/Session Factory. Must be
# unique. IMPORTANT: this should be the same name as used in the calls to HibernateHelper
# in the initialization code in the EditorPlugin class.
# In the Library examples the used name is: library.
# nsuri: a comma delimited list of namespace uris (incl. http://) of epackages that are stored in
# this EMFDataStore/Session Factory.
# query1, query2, ...: can be used to filter the content of the resource at the load action
# editorid: the id of the editor to use when opening this resource. This id can be found
# in the MANIFEST.MF > extensions tab > org.eclipse.ui.editors extension >
# Extension Element Details > id field.
# Either the editorid or the editorextension can be specified
# editorextension: the id of the editor to use when opening this resource. This id can be found
# in the MANIFEST.MF > extensions tab > org.eclipse.ui.editors extension >
# Extension Element Details > extensions field. In the Library EMF tutorial this extension
# is: library.
# Either the editorid or the editorextension can be specified
# dbname: the database name
# dburl: the database url with the database name.
# dbdialect: the database dialect (see hibernate documentation at: http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configuration.html#configuration-optional-dialects)
# dbuser: the database user
# dbpassword: the password of the database user
# dbdriver: the class name of the database driver

name=SrdV4
#query1=FROM Echostar
editorextension=srd
nsuri=http://srd
dbname=SrdV4

dbdriver=net.sourceforge.jtds.jdbc.Driver
#dburl=jdbc:jtds:sqlserver://che-aio2.echostar.com/SrdV4;
dburl=jdbc:jtds:sqlserver://che-csedevt1/SrdV4;
dbdialect=org.hibernate.dialect.SQLServerDialect

#dbdriver=com.microsoft.sqlserver.jdbc.SQLServerDriver
#dburl=jdbc:sqlserver://che-aio2.echostar.com;
#dburl=jdbc:sqlserver://che-csedevt1;

#dbuser=srduser421
#dbpassword=xxxx
#dbpassword=xxxx

dbuser=srdadmin
dbpassword=xxxxx

teneo.mapping.hibernate_mapping_file=true
teneo.naming.sql_fk_name_prefix=fk_
srd.message.server=200.50.32.186
srd.message.port=55555
#hibernate.hbm2ddl.auto=validate
hibernate.hbm2ddl.auto=create
Re: [Teneo] teneo.naming.sql_fk_name_prefix property ignored [message #796909 is a reply to message #796232] Sun, 12 February 2012 20:08 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
He Mark,
I also see this option:
hibernate_mapping_file=true

so Teneo won't generate a new mapping in this case/with this option setting.

gr. Martin

On 02/11/2012 06:11 PM, Mark Geib wrote:
> Martin,
>
> See below. What do you recommend as the best practice to configure Teneo/Hibernate in the current version.?
>
> Mark.
>
> #
> # Copyright 2005-2006, Elver.org (http://www.elver.org).
> #
> # Licensed under the Apache License, Version 2.0 (the "License");
> # you may not use this file except in compliance with the License.
> # You may obtain a copy of the License at
> #
> # http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing, software
> # distributed under the License is distributed on an "AS IS" BASIS,
> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> # See the License for the specific language governing permissions and
> # limitations under the License.
> # ----------------------------------------------------------------------
> #
> # Contains an example of the contents of an ehb file.
> # name: the name under which this information is used to register a EMFDataStore/Session Factory. Must be # unique.
> IMPORTANT: this should be the same name as used in the calls to HibernateHelper
> # in the initialization code in the EditorPlugin class. # In the Library examples the used name is: library.
> # nsuri: a comma delimited list of namespace uris (incl. http://) of epackages that are stored in # this
> EMFDataStore/Session Factory.
> # query1, query2, ...: can be used to filter the content of the resource at the load action
> # editorid: the id of the editor to use when opening this resource. This id can be found
> # in the MANIFEST.MF > extensions tab > org.eclipse.ui.editors extension > # Extension Element Details > id field.
> # Either the editorid or the editorextension can be specified
> # editorextension: the id of the editor to use when opening this resource. This id can be found
> # in the MANIFEST.MF > extensions tab > org.eclipse.ui.editors extension > # Extension Element Details > extensions
> field. In the Library EMF tutorial this extension
> # is: library.
> # Either the editorid or the editorextension can be specified
> # dbname: the database name
> # dburl: the database url with the database name.
> # dbdialect: the database dialect (see hibernate documentation at:
> http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configuration.html#configuration-optional-dialects)
> # dbuser: the database user
> # dbpassword: the password of the database user
> # dbdriver: the class name of the database driver
>
> name=SrdV4
> #query1=FROM Echostar
> editorextension=srd
> nsuri=http://srd
> dbname=SrdV4
>
> dbdriver=net.sourceforge.jtds.jdbc.Driver
> #dburl=jdbc:jtds:sqlserver://che-aio2.echostar.com/SrdV4;
> dburl=jdbc:jtds:sqlserver://che-csedevt1/SrdV4;
> dbdialect=org.hibernate.dialect.SQLServerDialect
>
> #dbdriver=com.microsoft.sqlserver.jdbc.SQLServerDriver
> #dburl=jdbc:sqlserver://che-aio2.echostar.com;
> #dburl=jdbc:sqlserver://che-csedevt1;
>
> #dbuser=srduser421
> #dbpassword=xxxx
> #dbpassword=xxxx
>
> dbuser=srdadmin
> dbpassword=xxxxx
>
> teneo.mapping.hibernate_mapping_file=true
> teneo.naming.sql_fk_name_prefix=fk_
> srd.message.server=200.50.32.186
> srd.message.port=55555
> #hibernate.hbm2ddl.auto=validate
> hibernate.hbm2ddl.auto=create
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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] teneo.naming.sql_fk_name_prefix property ignored [message #797021 is a reply to message #796909] Mon, 13 February 2012 00:32 Go to previous messageGo to next message
Mark Geib is currently offline Mark GeibFriend
Messages: 432
Registered: July 2009
Senior Member
Martin,

I am generating the hibernate mapping file with teneo from the ecore file manually.

Mark.
Re: [Teneo] teneo.naming.sql_fk_name_prefix property ignored [message #797254 is a reply to message #797021] Mon, 13 February 2012 08:34 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mark,
Yes but afaik the ehb file is not used when generating the mapping manually.

gr. Martin

On 02/13/2012 01:32 AM, Mark Geib wrote:
> Martin,
>
> I am generating the hibernate mapping file with teneo from the ecore file manually.
>
> Mark.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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] teneo.naming.sql_fk_name_prefix property ignored [message #797634 is a reply to message #797254] Mon, 13 February 2012 18:29 Go to previous messageGo to next message
Mark Geib is currently offline Mark GeibFriend
Messages: 432
Registered: July 2009
Senior Member
Understood. So to avoid the name clashes I need to not use the mapping file then.?
Mark.
Re: [Teneo] teneo.naming.sql_fk_name_prefix property ignored [message #797687 is a reply to message #797634] Mon, 13 February 2012 20:00 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Not sure that I understand, why would you want to generate the mapping file manually? I would let Teneo generate the
mapping at runtime, then this option will be used.

gr. Martin

On 02/13/2012 07:29 PM, Mark Geib wrote:
> Understood. So to avoid the name clashes I need to not use the mapping file then.?
> Mark.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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:[CDO] Loading Meta-Models
Next Topic:[Teneo] DAO best practise
Goto Forum:
  


Current Time: Tue Sep 24 13:43:35 GMT 2024

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

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

Back to the top