Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing files #2

Closed
palaciosdiego opened this issue Aug 7, 2018 · 22 comments
Closed

Missing files #2

palaciosdiego opened this issue Aug 7, 2018 · 22 comments
Labels
good first issue Good for newcomers

Comments

@palaciosdiego
Copy link

palaciosdiego commented Aug 7, 2018

Hi some errors that i get, i could not find the jooq folder in the repo.

import static org.blackdread.sqltojava.jooq.InformationSchema.INFORMATION_SCHEMA;
import static org.blackdread.sqltojava.jooq.tables.KeyColumnUsage.KEY_COLUMN_USAGE;

regards.

@paradox1979
Copy link

same issue, please up them.
regards.

@paradox1979
Copy link

to dpalaciosarriaga

i got it, before mvn installing, you must set the part of database url in pom.xml.
enjoy!

@Blackdread Blackdread added the good first issue Good for newcomers label Aug 8, 2018
@Blackdread
Copy link
Owner

Blackdread commented Aug 8, 2018

Yes indeed :)
I will add later in readme that pom.xml might need to be changed.
But the default url should work if you have wampserver running for example.

There is also the application.yml of course to set as well

@aronmosha
Copy link

Hello, I got the same issue.
image

@Blackdread
Copy link
Owner

  1. See jOOQ doc for code generation

  2. Make sure to have the mysql db running otherwise jooq cannot generate these two classes

  3. these classes are generated code so you need to do "mvn compile" at least once before running the main

@aronmosha
Copy link

Thanks, MySql is running and files are genereted except for InformationSchema and KeyColumnUsage
image

image

@Blackdread
Copy link
Owner

give your pom.xml, you must have changed it, this issue is very basic.
Default pom.xml I provide is supposed to generate the information schema with everything needed to generate the jdl file:


                <generator>
                        <name>org.jooq.util.DefaultGenerator</name>
                        <database>
                            <name>org.jooq.util.mysql.MySQLDatabase</name>
                            <includes>.*</includes>
                            <excludes></excludes>
                            <!--<inputSchema></inputSchema>--> <!-- This will generate all schema of db, better to only generate the one interested in -->
                            <inputSchema>information_schema</inputSchema>
                        </database>
                        <target>
                            <packageName>org.blackdread.sqltojava.jooq</packageName>
                            <directory>target/generated-sources/jooq</directory>
                        </target>
                </generator>

@aronmosha
Copy link

Thank you so much.
I found my mistake.
<database.url>jdbc:mysql:https://localhost:3306/DatabaseName</database.url>
I shoud not added the database name to connection String.

@Blackdread
Copy link
Owner

Do not change (only eventually port and localhost):

  • POM:
    <database.url>jdbc:mysql:https://localhost:3306/</database.url>

  • properties:
    url: jdbc:mysql:https://localhost:3306/?useUnicode=true&characterEncoding=utf8&useSSL=false

Most users will only change:

application:
    table-to-export: my_schema
    ignored-table-names:
        - databasechangelog
        - databasechangeloglock
    export:
        path: ./my-project-jdl.jh
type: jdl

@00xkhaled
Copy link

  1. See jOOQ doc for code generation
  2. Make sure to have the mysql db running otherwise jooq cannot generate these two classes
  3. these classes are generated code so you need to do "mvn compile" at least once before running the main

i tried to go mvn compile and i got this

A required class was missing while executing org.jooq:jooq-codegen-maven:3.10.5:generate: javax/xml/bind/JAXB

@Blackdread
Copy link
Owner

Blackdread commented Oct 10, 2018

Can you provide your configuration?
Also provide a screenshot of phpMyAdmin of dbs you have.

For example, for me property "table-to-export" would be "auto" which is db I want to export to JDL.
image

I just pulled this project and was able to compile the project.
I also restarted a build with travis, no errors.

Just make sure you have your db ON (wampserver for example), same port, the property "table-to-export" with name of schema to export -> name of db

Important
javax/xml/bind/JAXB has been removed, please use Java 8 for compile and runtime.

@00xkhaled
Copy link

Hello @Blackdread I'm currently working on Mac so I don't have PHPMyAdmin running but I have a sql server running and I'm using MAMP as a server, any suggestions ?

@ninjaspy
Copy link

Do not change (only eventually port and localhost):

  • POM:
    <database.url>jdbc:mysql:https://localhost:3306/</database.url>
  • properties:
    url: jdbc:mysql:https://localhost:3306/?useUnicode=true&characterEncoding=utf8&useSSL=false

Most users will only change:

application:
    table-to-export: my_schema
    ignored-table-names:
        - databasechangelog
        - databasechangeloglock
    export:
        path: ./my-project-jdl.jh
type: jdl

Hello

I ran 'mvn compile' but no jdl was generated from sql. Please do I need to run ant additional command?

@Blackdread
Copy link
Owner

what is your config?

@ninjaspy
Copy link

ninjaspy commented Mar 15, 2019

what is your config?
application.yml

spring:
    datasource:
            type: com.zaxxer.hikari.HikariDataSource
            url: jdbc:mysql:https://localhost:3306/?useUnicode=true&characterEncoding=utf8&useSSL=false
            username: root
            password: MyPassword
            hikari:
                data-source-properties:
                    cachePrepStmts: true
                    prepStmtCacheSize: 250
                    prepStmtCacheSqlLimit: 2048
                    useServerPrepStmts: true
    jooq:
        sql-dialect: mysql


application:
    table-to-export: my-database
    ignored-table-names:
        - databasechangelog
        - databasechangeloglock
    export:
        path: ./my-project-jdl.jh
        type: jdl


pom.xml


<database.url>jdbc:mysql:https://localhost:3306/my-database?useLegacyDatetimeCode=false&amp;serverTimezone=UTC</database.url>

                     <jdbc>
                        <driver>com.mysql.cj.jdbc.Driver</driver>
                        <url>${database.url}</url>
                        <user>root</user>
                        <password>MyPassword</password>
                    </jdbc

I noticed that application.yml is overwritten any time I run "mvn compile".

Thanks

@Blackdread
Copy link
Owner

do not change jdbc:mysql:https://localhost:3306/my-database

@ninjaspy
Copy link

ninjaspy commented Mar 15, 2019

do not change jdbc:mysql:https://localhost:3306/my-database
application.yml
Where do locate the jdl output that is generated? I can see it anywhere.
Is this okay. This is 100% generated.

 application.yml
spring:
    datasource:
            type: com.zaxxer.hikari.HikariDataSource
            url: jdbc:mysql:https://localhost:3306/?useUnicode=true&characterEncoding=utf8&useSSL=false
            username: root
            password:
            hikari:
                data-source-properties:
                    cachePrepStmts: true
                    prepStmtCacheSize: 250
                    prepStmtCacheSqlLimit: 2048
                    useServerPrepStmts: true
    jooq:
        sql-dialect: mysql


application:
    table-to-export: my_schema
    ignored-table-names:
        - databasechangelog
        - databasechangeloglock
    export:
        path: ./my-project-jdl.jh
        type: jdl`

@Blackdread
Copy link
Owner

@sreerajr137 create another issue

@hana-ch
Copy link

hana-ch commented Dec 17, 2019

Hello , i really want steps to run this project .. what are jooq and mysql version you're using .. and what are the config to change exactly .. thank you

@Blackdread
Copy link
Owner

use "mvn compile" or "mvnw compile", with db ON.
Then read full issue for any other build issue

@angelsplato
Copy link

is it possible to connect with a sqlserver database

@Blackdread
Copy link
Owner

See Readme or #52
Need to impl few changes to support it

@Blackdread Blackdread unpinned this issue Mar 5, 2021
Blackdread pushed a commit that referenced this issue Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

8 participants