Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

support for Oracle DB #73

Open
tomkuipers opened this issue Feb 19, 2015 · 7 comments
Open

support for Oracle DB #73

tomkuipers opened this issue Feb 19, 2015 · 7 comments
Labels

Comments

@tomkuipers
Copy link
Contributor

At the moment APIS is compatible with HSQL and MySQL databases, but what about support for Oracle DB. Is it possible to use an Oracle DB? What would have to added in the code or configured to support Oracle databases?

@gvanderploeg
Copy link
Contributor

No tests or any thought has been put into Oracle DB support.
The only (comforting) notion is that Apis uses JPA2 and Spring Data JPA so no vendor-specific stuff should be there.
As I'm typing this, I looked into the repository package, and see that the class AccessTokenRepository has some native queries in it.

My strategy would be: just try it, and look at AccessTokenRepository's queries if problems arise.

@tomkuipers
Copy link
Contributor Author

Thank for your answer, I will try and report back/

@javierisaai
Copy link

@tomkuipers Any chances you may share how did it go in trying to use this with Oracle DB?

@tomkuipers
Copy link
Contributor Author

@javierisaai I failed to port it to Oracle and used MySQL DB in the end. Sorry I can't be of any help.

@SamehSamy
Copy link

SamehSamy commented Jul 19, 2017

I can't see why this is not possible. did any one succeed in getting the APIs working with Oracle ?
@tomkuipers can you elaborate more on your findings, even if you were not able to find the solution ?
I've not tried it with Oracle as I'm in the process of evaluating the framework and see if it meets our needs. so appreciate the head start

@klausboeing
Copy link

klausboeing commented Sep 8, 2017

I set it to use with Oracle in the company I work for. At first I had problems with the name of tables that stray the size supported by Oracle.

To work, I defined smaller names and overwritten names in an orm.xml file.

<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd" 
                 version="2.0">

    <entity class="org.surfnet.oaaas.model.AuthorizationRequest" >

        <attributes>

            <element-collection name="requestedScopes">
                <collection-table name="AuthorizationRequest_reqScopes"/>
            </element-collection>          

            <element-collection name="grantedScopes">
                <collection-table name="AuthorizationRequest_gntScopes"/>
            </element-collection>

        </attributes>
    </entity>

</entity-mappings>

Follow the persistence.xml file with the orm.xml mapping

<persistence >
  <persistence-unit name="oauth">
    <properties>
      <property name="openjpa.jdbc.Schema" value="aut_owner"/>   
      <property name="openjpa.Log" value="slf4j" />
    </properties>
    <class>org.surfnet.oaaas.model.AbstractEntity</class>
    <class>org.surfnet.oaaas.model.AccessToken</class>
    <class>org.surfnet.oaaas.model.AuthorizationRequest</class>
    <class>org.surfnet.oaaas.model.Client</class>
    <class>org.surfnet.oaaas.model.ResourceServer</class>
    <mapping-file>META-INF/orm.xml</mapping-file>
  </persistence-unit>
</persistence>

@thiagozf
Copy link

@SamehSamy @tomkuipers I'm working on changes to make Apis to work with Oracle DB. It seems to be working fine, but needs more testing and validation. My progress so far can be found at thiagozf/apis#9. Once it is stable, I will submit the pull request. Feedback is appreciated!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants