Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions 22 .github/workflows/compute-covarage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Compute coverage

on:
push:
branches: [ main , develop ]


jobs:
compute-coverage:
name: Compute coverage
runs-on: ubuntu-latest
environment:
name: coveralls
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2.5.0
with:
java-version: 8
distribution: 'zulu'
architecture: x64
- name: Build and test
run: cd sqlschema2java-core && mvn clean test run-coveralls jacoco:report coveralls:report -DrepoToken=${{ secrets.coveralls_repo_token }}
4 changes: 2 additions & 2 deletions 4 .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
needs: publish-core
steps:
- name: Sleep for 30 seconds
- name: Sleep for 5 minutes
uses: jakejarvis/wait-action@master
with:
time: '5m'
Expand All @@ -44,7 +44,7 @@ jobs:
with:
java-version: '11'
distribution: 'adopt'
- name: Publish package SQLSchema2Java Core
- name: Publish package SQLSchema2Java MavenPLugin
run: |
cd sqlschema2java-maven-plugin
mvn --batch-mode deploy
Expand Down
2 changes: 1 addition & 1 deletion 2 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![CodeQL main](https://github.com/Sassine/sqlschema2java/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/Sassine/sqlschema2java/actions/workflows/codeql-analysis.yml)

[![GitHub release](https://img.shields.io/github/release/Sassine/sqlschema2java.svg)](https://GitHub.com/Sassine/sqlschema2java/releases/)
[![Coverage Status](https://coveralls.io/repos/github/Sassine/sqlschema2java/badge.svg?branch=develop)](https://coveralls.io/github/Sassine/sqlschema2java?branch=develop)
[![Coverage Status](https://coveralls.io/repos/github/Sassine/sqlschema2java/badge.svg)](https://coveralls.io/github/Sassine/sqlschema2java)

![Logo SQL2JAVA and website adress sassine.dev/sqlschema2java](https://sassine.dev/assets/images/SQLSchema2Java_Logo2.png)

Expand Down
6 changes: 3 additions & 3 deletions 6 sqlschema2java-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@
<exclude>**/*SqlBaseListener*</exclude>
<exclude>**/*SqlLexer*</exclude>
<exclude>**/*SqlParser*</exclude>
<exclude>**/*Main</exclude>
<exclude>**/*Sqlschema2Java</exclude>
<exclude>**/*Main*</exclude>
<exclude>**/*Sqlschema2Java*</exclude>
<exclude>**/builder/**</exclude>
</excludes>
</configuration>
</plugin>
Expand Down Expand Up @@ -190,7 +191,6 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class FieldModel {
private String defaultValue;
private Integer minOccurs;
private String maxOccurs;
private boolean isEmbedded;

public FieldModel(String name) {
this.name = name;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dev.sassine.api.structure.model.java;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

import org.junit.Test;

public class EntityModelTest {


@Test
public void getFieldForNameTest() {
var entity = new EntityModel("table", "auto");
var field = new FieldModel();
field.setName("teste_1");
field.setType("Integer");
entity.getFields().add(field);
var value = entity.getFieldForName("teste_1");
assertEquals("teste1",value.getCamelName());
assertEquals("Teste1",value.getCamelNameUpper());
assertEquals("Integer",value.getType());
assertNull(entity.getFieldForName("teste_2"));
}

}
76 changes: 42 additions & 34 deletions 76 sqlschema2java-example/pom.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dev.sasine.api</groupId>
<artifactId>sqlschema2java-example</artifactId>
<version>1.0.0-beta1</version>
<packaging>pom</packaging>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dev.sasine.api</groupId>
<artifactId>sqlschema2java-example</artifactId>
<version>1.0.0-beta1</version>
<packaging>pom</packaging>

<developers>
<developer>
Expand All @@ -20,35 +20,43 @@
</roles>
</developer>
</developers>

<properties>
<is.postgres>false</is.postgres>
<auto.increment.enabled>false</auto.increment.enabled>
<path.arquivo>./input.sql</path.arquivo>
</properties>
<is.postgres>false</is.postgres>
<auto.increment.enabled>false</auto.increment.enabled>
<path.arquivo>./input.sql</path.arquivo>
</properties>


<build>
<plugins>
<plugin>
<groupId>dev.sassine.api</groupId>
<artifactId>sqlschema2java-maven-plugin</artifactId>
<version>1.0.0-beta1</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<isPostgres>${is.postgres}</isPostgres>
<sourceDirectory>${path.arquivo}</sourceDirectory>
<useAutoIncrement>${auto.increment.enabled}</useAutoIncrement>
<debugEnabled>false</debugEnabled>
</configuration>
</plugin>
</plugins>
</build>

<build>
<plugins>
<plugin>
<groupId>dev.sassine.api</groupId>
<artifactId>sqlschema2java-maven-plugin</artifactId>
<version>1.0.0-beta1</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<isPostgres>${is.postgres}</isPostgres>
<sourceDirectory>${path.arquivo}</sourceDirectory>
<useAutoIncrement>${auto.increment.enabled}</useAutoIncrement>
<debugEnabled>false</debugEnabled>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>github</id>
<name>GitHub Packages SQLSchema2Java</name>
<url>https://maven.pkg.github.com/Sassine/sqlschema2java</url>
</repository>
</repositories>

</project>
2 changes: 1 addition & 1 deletion 2 sqlschema2java-example/runSqlSchema2Java.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

mvn dev.sassine.api:sqlschema2java-maven-plugin:sqlschema2java
mvn dev.sassine.api:sqlschema2java-maven-plugin:generate
Morty Proxy This is a proxified and sanitized view of the page, visit original site.