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

Fix error in import-jdl and many-to-many #224

Merged
merged 3 commits into from May 25, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion generators/common/templates/dotnetcore/README.md.ejs
Expand Up @@ -20,7 +20,7 @@
<%_
let DOCUMENTATION_ARCHIVE_URL = `${DOCUMENTATION_URL + DOCUMENTATION_ARCHIVE_PATH}v${jhipsterVersion}`;
_%>
This application was generated using JHipster <%= jhipsterVersion %> and JHipster .Net Core 0.3.0, you can find documentation and help at [<%= DOCUMENTATION_ARCHIVE_URL %>](<%= DOCUMENTATION_ARCHIVE_URL %>).
This application was generated using JHipster <%= jhipsterVersion %> and JHipster .Net Core 1.0.0-alpha, you can find documentation and help at [<%= DOCUMENTATION_ARCHIVE_URL %>](<%= DOCUMENTATION_ARCHIVE_URL %>).

## Development

Expand Down
1 change: 1 addition & 0 deletions generators/entity-server/files.js
Expand Up @@ -101,6 +101,7 @@ function writeFiles() {
return {
writeServerFiles() {
this.relationships.forEach(relationship => {
// const relationship = relationship;
if (relationship.relationshipType === 'many-to-many') {
joinEntitiesTemplates.push({
file: 'Project/Models/JoinEntity.cs',
Expand Down
Expand Up @@ -21,12 +21,12 @@ let joinEntityTableName;
let joinEntityClassName;
let ownerSide;
let idx = 0;
while (idx < relationships.length && !relationship) {
if (relationships[idx].relationshipType == 'many-to-many' && !relationships[idx].joinEntityGenerated) {
relationship = relationships[idx];
while (idx < relationships.length) {
relationship = relationships[idx];
joinEntityTableName = relationships[idx].joinEntityNameSnakeCased;
joinEntityClassName = relationships[idx].joinEntityNamePascalized;
if (relationships[idx].relationshipType == 'many-to-many') {
relationships[idx].joinEntityGenerated = true;
joinEntityTableName = relationships[idx].joinEntityNameSnakeCased;
joinEntityClassName = relationships[idx].joinEntityNamePascalized;
ownerSide = relationships[idx].ownerSide;
}
idx++;
Expand Down
Expand Up @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Mvc;
using JHipsterNet.Config;
using Microsoft.Extensions.Options;

namespace MyCompany.Controllers
namespace <%= namespace %>.Controllers
{
[Route("")]
[ApiController]
Expand Down
Expand Up @@ -4,12 +4,12 @@ using System.Security.Claims;
using System.Security.Principal;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyCompany.Controllers;
using MyCompany.Security;
using MyCompany.Service.Dto;
using <%= namespace %>.Controllers;
using <%= namespace %>.Security;
using <%= namespace %>.Service.Dto;
using Xunit;

namespace MyCompany.Test.Controllers
namespace <%= namespace %>.Test.Controllers
{
public class AccountControllerTest
{
Expand Down
Expand Up @@ -13,14 +13,14 @@
limitations under the License.
-%>
using FluentAssertions;
using MyCompany.Test.Setup;
using <%= namespace %>.Test.Setup;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
using Xunit;

namespace MyCompany.Test.Controllers {
namespace <%= namespace %>.Test.Controllers {
public class ProfileInfoControllerIntTest
{

Expand Down