[hibernate-dev] SchemaExport usage ?

Sanne Grinovero sanne at hibernate.org
Thu May 14 19:54:01 EDT 2015


It's all working now but I copied a couple of utility classes from
ORM, as they were part of the tests.
essentially I needed JdbcConnectionAccessImpl :
 - https://github.com/hibernate/hibernate-search/commit/12df1b654cefad17b5186e3d3f4c5419d41295d1#diff-f3753a568f2086a66b118016751498edR21

Filed HHH-9801, very low priority though.

On 13 May 2015 at 17:48, Sanne Grinovero <sanne at hibernate.org> wrote:
> Thanks Steve, that was very helpful.
>
> On 13 May 2015 at 05:09, Steve Ebersole <steve at hibernate.org> wrote:
>> HHH-9792 - Clean up missed Configuration methods
>>
>> On Tue, May 12, 2015 at 11:05 PM, Steve Ebersole <steve at hibernate.org>
>> wrote:
>>>
>>> None of the bootstrapping contracts are kept around after the SF is
>>> bootstrapped.  Nothing different there from Configuration.  There is nothing
>>> meaningful on SessionFactory for performing any schema tools.  For what its
>>> worth I hope to change that with the metamodel work (6.0), but for now this
>>> is the case.
>>>
>>> The Configuration methods should be removed.  I just missed them.
>>>
>>> Take a look at
>>> org.hibernate.test.multitenancy.schema.SchemaBasedMultiTenancyTest in
>>> regards to how I do this for my tests
>>>
>>> On Tue, May 12, 2015 at 5:55 PM, Sanne Grinovero <sanne at hibernate.org>
>>> wrote:
>>>>
>>>> We have some Hibernate Search tests which use multi-tenancy, and
>>>> require the schema to be exported explicitly. I'm trying to get these
>>>> to run now with Hibernate ORM 5.
>>>>
>>>> I can't use the command line tool, as the test configuration options
>>>> should be passed by instance (there are several unit tests to be run,
>>>> each with its own configuration).
>>>>
>>>> I already have a SessionFactory started, so I'd prefer to use its
>>>> metadata if possible, but while SchemaExport has plenty of
>>>> constructors, it doesn't seem to have one I could use.
>>>>
>>>> This one looks like a good candidate:
>>>>
>>>>  SchemaExport(ConnectionHelper connectionHelper, MetadataImplementor
>>>> metadata)
>>>>
>>>> as I do have a ConnectionHelper instance. But while I have a reference
>>>> to my SessionFactory, and a reference to the Configuration which
>>>> started it, I couldn't find a way to get a MetadataImplementor from
>>>> these?
>>>>
>>>> Wouldn't it be very useful to have something like
>>>>
>>>> SchemaExport(ConnectionHelper connectionHelper, SessionFactorty sf) ?
>>>>
>>>> I think all multi-tenancy users would need something similar.
>>>>
>>>>
>>>> Partially unrelated, the methods:
>>>>  - org.hibernate.cfg.Configuration.generateDropSchemaScript(Dialect)
>>>>  - org.hibernate.cfg.Configuration.generateSchemaCreationScript(Dialect)
>>>>
>>>> are returning an hard coded String[0]. Should these be implemented
>>>> before 5.0.0.Final, or are these meant to be deprecated?
>>>>
>>>> Thanks,
>>>> Sanne
>>>> _______________________________________________
>>>> hibernate-dev mailing list
>>>> hibernate-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>>
>>>
>>


More information about the hibernate-dev mailing list