-
1. Re: Getting at a sql-type mapping
javajedi May 14, 2003 10:57 AM (in response to javajedi)So now I'm trying to get at an instance of JDBCTypeMappingMetaData so I can call getSqlTypeForJavaType() and running into a problem. Here's the only path I've been able to find to get me there (in theory) from an EntityContainer:
CMPPersistenceManager man = (CMPPersistenceManager) container.getPersistenceManager();
JDBCStoreManager store = (JDBCStoreManager) man.getPersistenceStore();
JDBCTypeFactory factory = store.getJDBCTypeFactory();
return factory.getTypeMapping().getSqlTypeForJavaType(c);
The problem is, the call to getPersistenceManager() returns an instance of org.jboss.resource.connectionmanager.CachedConnectionInterceptor, which doesn't expose getPersistenceStore(). Looking at the code, it looks like it wraps the real PersistenceManager and then hides it away so there's no way to actually access it. At this point, I'm stuck. Can anyone offer any suggestions on how to get at the PersistenceManager, or some other way to get at the functionality of getSqlTypeForJavaType? Thanks. -
2. Re: Getting at a sql-type mapping
javajedi May 19, 2003 12:52 PM (in response to javajedi)Based on the deafening silence here, I assume nobody has a good answer for me. :) I ended up defining a single "adaptor" entity bean with a different container configuration that removed the CachedConnectionInterceptor, then got at the type mapping through that. Works great. But this is a lame hack, and I still can't get to other bean-specific attributes (e.g. table name) that is on each bean's respective instance of JDBCStoreManager. I filed on bug on this problem at http://sourceforge.net/tracker/?func=detail&aid=740024&group_id=22866&atid=376685
-
3. Re: Getting at a sql-type mapping
bleupen May 28, 2003 10:15 AM (in response to javajedi)are you creating an interceptor to do this? if so, the code you have written will work if you put it in the interceptor's create() method and set an instance variable.
b