(12:32:32 PM) gbadner-gmail: if no schema is provided in @Table, shouldn't hibernate assume table should be in the default schema? (12:33:09 PM) gbadner-gmail: seems reasonable that orm would pass the default schema to validator (12:33:23 PM) gbadner-gmail: rather than no schema (12:33:30 PM) Steve Ebersole: yes, but, it really just assumes any namespace that can be seen (12:34:32 PM) Steve Ebersole: not sure what you mean by "no schema" (12:34:53 PM) Steve Ebersole: for databases that utilize schemas, there is never "no schema" (12:35:04 PM) Steve Ebersole: so not sure what you mean there (12:35:49 PM) Steve Ebersole: you mean in terms of the DatabaseMetaData calls? (12:36:29 PM) Steve Ebersole: for those this is the difference between passing null and "" (12:37:30 PM) Steve Ebersole: iirc tools deals with this in an awkward way (12:37:44 PM) Steve Ebersole: like it pulls all tables first maybe (12:37:48 PM) Steve Ebersole: something like that (12:38:16 PM) Steve Ebersole: but i seem to remember it does not apply schema/catalog filters in the best way (12:38:23 PM) Steve Ebersole: however that happens (12:39:44 PM) gbadner-gmail: iiuc, validator says the table exists because it finds a table in some non-default schema/catalog, but ORM throwns an exception because it's not in the default schema/catalog (12:40:08 PM) Steve Ebersole: um (12:40:26 PM) gbadner-gmail: looks like when @Table does not have the schema or catalog, those values are passed as null (12:41:11 PM) Steve Ebersole: null == do not filter based on that (12:41:13 PM) gbadner-gmail: at least that's what a commentsays (12:41:25 PM) Steve Ebersole: aka, pull from any visible schema (12:41:31 PM) gbadner-gmail: ah, ok, so that is expected (12:41:53 PM) Steve Ebersole: well its wrong (12:42:09 PM) Steve Ebersole: however (12:42:28 PM) Steve Ebersole: i think the only thing that could be changed here is to have validator fail (12:42:48 PM) Steve Ebersole: as is, the set up is not correct to see that table (12:42:49 PM) gbadner-gmail: yeah, I think that's better than having ORM fail later when the table is not found (12:43:37 PM) gbadner-gmail: the problem here is that validator says it's ok, but it's not found by orm (12:43:48 PM) Steve Ebersole: i just am not sure how this should work between dbs that use catalogs but not schema and vixce versa (12:44:01 PM) Steve Ebersole: yes, i get what the mismatch is (12:44:10 PM) gbadner-gmail: ah, ok; (12:44:36 PM) gbadner-gmail: iac, the workaround is to just put the schema/catalog in the @Table (12:45:09 PM) Steve Ebersole: sure (12:45:19 PM) gbadner-gmail: then validator and orm would would either both be OK, or both broken (12:45:26 PM) Steve Ebersole: i think the solution is to be better at filtering these results (12:45:35 PM) Steve Ebersole: but (12:45:55 PM) Steve Ebersole: that requires understanding which dbs use catalog, which use schema and which use both (12:46:14 PM) Steve Ebersole: and applying that to the DatabaseMetaData calls properly (12:46:30 PM) gbadner-gmail: would that be defined on the dialect? (12:46:41 PM) gbadner-gmail: supportsSchema(), supportsCatalog()? (12:46:55 PM) Steve Ebersole: i'd prefer one call (12:47:01 PM) Steve Ebersole: returning an enum (12:47:31 PM) gbadner-gmail: SCHEMA_ONLY, CATALOG_ONLY, CATALOG_AND_SCHEMA (12:47:37 PM) Steve Ebersole: possibly even with the enum handling name formatting (12:47:51 PM) Steve Ebersole: but thats not pertinent here (12:51:35 PM) Steve Ebersole: tbh, i am not sure there is any that support "just catalog" (12:51:48 PM) Steve Ebersole: tbh, i am not sure that really even makes sense (12:52:01 PM) gbadner-gmail: no idea (12:53:02 PM) Steve Ebersole: catalogs are essentially defined as collections of schemas (12:53:14 PM) Steve Ebersole: schemas are what hold tables, etc (12:53:43 PM) Steve Ebersole: but, its probably best to allow for every oddball (12:54:59 PM) Steve Ebersole: I'd also want to collect this into a unified contract (12:55:06 PM) gbadner-gmail: ok, so this would be an improvement; and it's also not going to get into eap 6.3.3/6.4.0 (12:55:16 PM) Steve Ebersole: Dialect.getSchemaSupport() (12:55:23 PM) gbadner-gmail: ah, I see (12:55:48 PM) Steve Ebersole: SchemaSupport#renderName( ... ) (12:57:10 PM) Steve Ebersole: SchemaSupport#getSupportStyle() (12:57:12 PM) Steve Ebersole: etc (12:57:57 PM) gbadner-gmail: do you see backporting this into 4.2 branch? (12:58:37 PM) Steve Ebersole: i see backporting this to any branch that has this problem (all of them) where we want it fixed (12:58:52 PM) gbadner-gmail: ok (12:59:10 PM) Steve Ebersole: i hate this idea of porting solutions differently to different branches (12:59:18 PM) Steve Ebersole: i think that is a recipse for disaster (12:59:45 PM) gbadner-gmail: right, that's why I'm wondering if we should backport to 4.2 when there is an easy workaround (01:00:08 PM) Steve Ebersole: well, thats a pretty onerous workaround though (01:00:41 PM) Steve Ebersole: effectively rendering default schema/catalog moot for those users
|