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

Custom column id as UUID for oracle database #25973

Open
1 task done
romarioliveira25 opened this issue Apr 26, 2024 · 0 comments
Open
1 task done

Custom column id as UUID for oracle database #25973

romarioliveira25 opened this issue Apr 26, 2024 · 0 comments

Comments

@romarioliveira25
Copy link

Overview of the issue

When using the annotation @id to define a custom column id as UUID in Oracle Database, the generator create liquibase changelogs with column type ${uuidType}.
With this, liquibase generate table column with type RAW(16), instead of VARCHAR2(100) as occurs with jHipster built in entities.

Motivation for or Use Case

Turn UUID a pattern for column id of all entities like is in jHipster built in entities.

Reproduce the error
@dto(mapstruct)
entity Area {
    // Need update changelog type from uuid to varchar(100)
    // Liquibase change uuid to raw at oracle database
    @Id id UUID
    nome String required
    ordem Integer required
    slug String required
}
Related issues

Suggest a Fix

By now, I have no code to fix it, but the expected behavior would be as occurs with jHipster built in entities, the use custom id columns

JHipster Version(s)

8.3.0

JHipster configuration
<details>
<summary>.yo-rc.json file</summary>
<pre>
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "oauth2",
    "baseName": "integra",
    "blueprints": [
      {
        "name": "generator-jhipster-migrate",
        "version": "1.0.0"
      }
    ],
    "buildTool": "maven",
    "cacheProvider": "ehcache",
    "clientFramework": "angular",
    "clientTestFrameworks": [
      "cypress"
    ],
    "clientTheme": "none",
    "creationTimestamp": 1710166091700,
    "cypressAudit": true,
    "cypressCoverage": true,
    "databaseType": "sql",
    "devDatabaseType": "oracle",
    "devServerPort": 4200,
    "enableGradleEnterprise": null,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": [
      "SistemaUser",
      "Historico",
      "Area",
      "Sistema",
      "ControleAcesso"
    ],
    "feignClient": false,
    "gradleEnterpriseHost": null,
    "jhipsterVersion": "8.3.0",
    "languages": [
      "en",
      "pt-br"
    ],
    "lastLiquibaseTimestamp": 1710166211000,
    "messageBroker": false,
    "microfrontend": null,
    "microfrontends": [],
    "nativeLanguage": "en",
    "packageName": "mp.mpro.integra",
    "prodDatabaseType": "oracle",
    "reactive": false,
    "searchEngine": false,
    "serverPort": null,
    "serverSideOptions": [],
    "serviceDiscoveryType": false,
    "skipUserManagement": true,
    "syncUserWithIdp": true,
    "testFrameworks": [
      "cypress"
    ],
    "websocket": false,
    "withAdminUi": true
  }
}
</pre>
</details>
<details>
  <summary>JDL definitions</summary>
  <pre>
  @dto(mapstruct)
  entity Area {
      // Need update changelog type from uuid to varchar(100)
      // Liquibase change uuid to raw at oracle database
      @Id id UUID
      nome String required
      ordem Integer required
      slug String required
  }
  </pre>
  </details>
Entity configuration(s) entityName.json files generated in the .jhipster directory
{
  "annotations": {
    "changelogDate": "20240311140911",
    "dto": "mapstruct"
  },
  "applications": "*",
  "fields": [
    {
      "fieldName": "id",
      "fieldType": "UUID",
      "options": {
        "id": true
      }
    },
    {
      "fieldName": "nome",
      "fieldType": "String",
      "fieldValidateRules": ["required"]
    },
    {
      "fieldName": "ordem",
      "fieldType": "Integer",
      "fieldValidateRules": ["required"]
    },
    {
      "fieldName": "slug",
      "fieldType": "String",
      "fieldValidateRules": ["required"]
    }
  ],
  "name": "Area",
  "relationships": [
    {
      "otherEntityName": "sistema",
      "otherEntityRelationshipName": "area",
      "relationshipName": "sistema",
      "relationshipSide": "left",
      "relationshipType": "one-to-many"
    }
  ],
  "searchEngine": "no"
}

Browsers and Operating System

Ubuntu 22.04
Google Chrome 124.0.6367.60

  • Checking this box is mandatory (this is just to show you read everything)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant