Skip to content

Commit

Permalink
Merge pull request #81 from jGauravGupta/FISH-10074
Browse files Browse the repository at this point in the history
FISH-10074 Application generation failed with CONFERENCE ER Diagram
  • Loading branch information
jGauravGupta authored Nov 15, 2024
2 parents 3baa3b0 + 6763647 commit e123370
Show file tree
Hide file tree
Showing 18 changed files with 643 additions and 694 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fish.payara.starter</groupId>
<artifactId>payara-starter-parent</artifactId>
<version>1.0-beta11</version>
<version>1.0-beta12</version>
<packaging>pom</packaging>
<name>Payara Starter Parent</name>
<description>Payara Starter Parent</description>
Expand Down
4 changes: 2 additions & 2 deletions starter-archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
<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>
<artifactId>payara-starter-archetype</artifactId>
<version>1.0-beta11</version>
<version>1.0-beta12</version>
<packaging>maven-archetype</packaging>
<name>Payara Starter Archetype</name>
<description>Archetype for Payara Platform application.</description>
<parent>
<groupId>fish.payara.starter</groupId>
<artifactId>payara-starter-parent</artifactId>
<version>1.0-beta11</version>
<version>1.0-beta12</version>
<relativePath>../pom.xml</relativePath>
</parent>
<build>
Expand Down
2 changes: 1 addition & 1 deletion starter-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>fish.payara.starter</groupId>
<artifactId>payara-starter-parent</artifactId>
<version>1.0-beta11</version>
<version>1.0-beta12</version>
</parent>
<artifactId>payara-starter-generator</artifactId>
<name>Payara Starter Generator</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@
import fish.payara.starter.application.util.AttributeType;
import static fish.payara.starter.application.util.AttributeType.LOCAL_DATE;
import static fish.payara.starter.application.util.AttributeType.LOCAL_DATE_TIME;
import static fish.payara.starter.application.util.StringHelper.pluralize;
import static fish.payara.starter.application.util.StringHelper.startCase;
import static fish.payara.starter.application.util.StringHelper.titleCase;
import static fish.payara.starter.application.util.StringUtils.firstLower;
import static fish.payara.starter.application.util.StringUtils.firstUpper;
import static fish.payara.starter.application.util.StringUtils.kebabCase;
import static fish.payara.starter.application.util.StringUtils.pluralize;
import static fish.payara.starter.application.util.StringUtils.startCase;
import static fish.payara.starter.application.util.StringUtils.titleCase;
import jakarta.json.bind.annotation.JsonbTransient;
import jakarta.json.bind.annotation.JsonbTypeSerializer;
import java.util.ArrayList;
Expand Down Expand Up @@ -109,7 +112,7 @@ public Attribute(String name, boolean multi, String relation) {
this.type = relation;
this.multi = multi;
}

/**
* Returns the name of the attribute.
*
Expand All @@ -129,44 +132,14 @@ public String getStartCaseName() {
return startCase(name);
}

/**
* Returns the name of the attribute in lower case format.
*
* @return the lower case name
*/
@JsonbTransient
public String getLowerCaseName() {
return name.toLowerCase();
}

/**
* Returns the name of the attribute in title case format.
*
* @return the title case name
*/
@JsonbTransient
public String getTitleCaseName() {
return titleCase(name);
}

/**
* Returns the pluralized lower case name of the attribute.
*
* @return the pluralized lower case name
*/
@JsonbTransient
public String getLowerCasePluralizeName() {
return pluralize(name.toLowerCase());
}

/**
* Returns the pluralized title case name of the attribute.
*
* @return the pluralized title case name
*/
@JsonbTransient
public String getTitleCasePluralizeName() {
return pluralize(titleCase(name));
return firstUpper(name);
}

/**
Expand Down Expand Up @@ -344,6 +317,10 @@ public void setMulti(boolean multi) {
this.multi = multi;
}

public String getApiUrl() {
return kebabCase(firstLower(type));
}

@Override
public String toString() {
return "\n\t\tAttribute{name=" + name + ", type=" + type + ", isPrimaryKey=" + primaryKey + '}';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public void addEntity(Entity entity) {

public Entity getEntity(String entityName) {
for (Entity entity : entities) {
if (entity.getName().equals(entityName)) {
if (entity.getName().equals(entityName)
|| entity.getClassName().equals(entityName)) {
return entity;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@
*/
package fish.payara.starter.application.domain;

import static fish.payara.starter.application.util.StringHelper.firstUpper;
import static fish.payara.starter.application.util.StringHelper.pluralize;
import static fish.payara.starter.application.util.StringHelper.startCase;
import static fish.payara.starter.application.util.StringHelper.titleCase;
import static fish.payara.starter.application.util.StringUtils.firstUpper;
import static fish.payara.starter.application.util.StringUtils.startCase;
import static fish.payara.starter.application.util.StringUtils.titleCase;
import jakarta.json.bind.annotation.JsonbTransient;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -111,16 +110,6 @@ public String getTitleCaseName() {
return titleCase(getClassName());
}

@JsonbTransient
public String getLowerCasePluralizeName() {
return pluralize(getLowerCaseName());
}

@JsonbTransient
public String getTitleCasePluralizeName() {
return pluralize(getTitle());
}

public List<Attribute> getAttributes() {
return attributes;
}
Expand Down
Loading

0 comments on commit e123370

Please sign in to comment.