Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [ Teneo ] USE_MAPPING_FILE minor enhancement
[ Teneo ] USE_MAPPING_FILE minor enhancement [message #608700] Wed, 11 July 2007 18:29
Jason Henriksen is currently offline Jason HenriksenFriend
Messages: 231
Registered: July 2009
Senior Member
Hi All,

I ran into some small trouble getting
teneoProps.setProperty(PersistenceOptions.USE_MAPPING_FILE, "true");
to work. I had a mapping file in the root directory and it looked like it
was working, but when I changed the mapping file, the changes wouldn't show
up.

It turns out that the code that looks for the mapping file looks for the
resource in ";hibernate.hbm.xml" which it doesn't find. It then just builds
its own hbm from the available code and seems like it worked even though it
actually didn't. I fixed it by adding code to StoreUtil.java like this:

//--- JJH support for userSpecifiedHBMFile
private static String userSpecifiedHBMFile;
public static String getSpecificMappingFile()
{
return userSpecifiedHBMFile;
}

public static void setSpecificMappingFile(String val)
{
userSpecifiedHBMFile=val;
}
//--- JJH

Then in StoreUtil.getFileList() I added:

//--- JJH: Want to specify a teneo generated mapping file that isn't
named hibernate.hbm.xml
if(null != getSpecificMappingFile()){
result.add(getSpecificMappingFile());
}
//--- JJH
return result.toArray(new String[result.size()]);


This should really go into Properties, but I didn't want to make property
names without your involvement since the documentation has to be updated and
what not. But the idea is helpful because I can specify exactly which hbm
file to use. (I have a different hbm for each project and I prefer to not
have them all named the same thing, even if they are in different projects)

If you give me a property name to use, I'll make this code nicer, put it
into a Property and submit it.

Thanks!

Jason Henriksen
Previous Topic:JPA Annotation for Composite Foregin Key
Next Topic:[ Teneo ] USE_MAPPING_FILE minor enhancement
Goto Forum:
  


Current Time: Sat Apr 27 02:03:55 GMT 2024

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

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

Back to the top