We would need peristence.xml just to list the entity-classes. Everything else would be
configured through keycloak-server.json, and we could support both Hibernate property
names and simpler Keycloak names.
The nice thing about having a persistence.xml with just the entity-classes is that if
someone is a Hibernate wizard they can just not specify anything in keycloak-server.json,
and just configure it all through the persistence.xml
BTW if we did this, do we even have to explode the auth-server.war in the dist? Templates
are extracted to standalone/configuration/templates and configuration is done through
standalone/configuration/keycloak-server.json.
----- Original Message -----
From: "Bill Burke" <bburke(a)redhat.com>
To: "Stian Thorgersen" <stian(a)redhat.com>
Cc: keycloak-dev(a)lists.jboss.org
Sent: Thursday, 17 July, 2014 2:30:18 PM
Subject: Re: [keycloak-dev] Additional things to consider for 1.0.final
On 7/17/2014 9:20 AM, Stian Thorgersen wrote:
>
>
> ----- Original Message -----
>> From: "Bill Burke" <bburke(a)redhat.com>
>> To: keycloak-dev(a)lists.jboss.org
>> Sent: Thursday, 17 July, 2014 2:14:21 PM
>> Subject: Re: [keycloak-dev] Additional things to consider for 1.0.final
>>
>>
>>
>> On 7/17/2014 8:55 AM, Stian Thorgersen wrote:
>>> As we didn't have enough things to do last minute I come up with more
>>> things which I think we should do for 1.0.final:
>>>
>>> 1. Configure JPA through keycloak-server.json instead of persistence.xml
>>>
>>> This would be super simple to do, and would let us have a single
>>> persistence.xml for everything (testsuite, server, project-integrations).
>>> Everything worthy of configuring in persistence.xml (including
>>> datasource)
>>> can be passed in the Map overrides when creating the
>>> EntityManagerFactory.
>>>
>>
>> -1. I don't think learning a new configuration format for
>> persistence.xml is user friendly. Users would have to translate the
>> Hibernate documentation to our json format.
>
> It would support both, configuration can either be done through
> persistence.xml or keycloak-server.json. We could use the same property
> names, so it would just be a matter of putting it in keycloak-server
> instead of properties in persistence.xml.
>
> Also, why do our users need to understand Hibernate/JPA just to be able to
> configure what data-source to use for Keycloak?
>
Actually, you're right. We wouldn't even need a persistence.xml file.
We wouldn't need even any JPA specific settings in keycloak-server.json
by default too, right?
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com