Missing user class - linking an object to a user object in Microservice

I want to create an object that has a many-to-one relationship with a JHipster user entity.

I used JDL-Studio to create the following entity and relationship to User, which is imported into my Microservice as a .jh file using jhipster import-jdl:

entity Profile {
    name String required
    bio String
    location String
    photo ImageBlob
}

relationship ManyToOne {
    Profile{user} to User
}

angularSuffix * with mySuffix

dto * with mapstruct

When compiling my Micro service, I get the following errors:

Profile.java:44: error: cannot find private user user character; symbol: class User location: class Profile

ProfileMapper.java:12: error: cannot find @Mapper character (componentModel = "spring", uses = {UserMapper.class,}) character: class UserMapper

ProfileMapper.java:12: : @Mapper @Mapper (componentModel = "spring", = {UserMapper.class,})

43-44 .java:

@ManyToOne
private User user;

ProfileMapper.java :

package com.moogrisoft.openseas.service.mapper;

import com.moogrisoft.openseas.domain.*;
import com.moogrisoft.openseas.service.dto.ProfileDTO;

import org.mapstruct.*;
import java.util.List;

/**
 * Mapper for the entity Profile and its DTO ProfileDTO.
 */
@Mapper(componentModel = "spring", uses = {UserMapper.class, })
public interface ProfileMapper {

    @Mapping(source = "user.id", target = "userId")
    ProfileDTO profileToProfileDTO(Profile profile);

    List<ProfileDTO> profilesToProfileDTOs(List<Profile> profiles);

    @Mapping(source = "userId", target = "user")
    Profile profileDTOToProfile(ProfileDTO profileDTO);

    List<Profile> profileDTOsToProfiles(List<ProfileDTO> profileDTOs);
    /**
     * generating the fromId for all mappers if the databaseType is sql, as the class has relationship to it might need it, instead of
     * creating a new attribute to know if the entity has any relationship from some other entity
     *
     * @param id id of the entity
     * @return the entity instance
     */

    default Profile profileFromId(Long id) {
        if (id == null) {
            return null;
        }
        Profile profile = new Profile();
        profile.setId(id);
        return profile;
    }


}

UserMapper, .

, , Microservice - .

+3
1

JHipster User UAA.

UAA . , ​​ . . UAA, , https://github.com/xetys/microxchng-workshop/tree/master/uaa

- , . https://jhipster.imtqy.com/microservices-architecture/#generating_entities

. , . , , , , , ( ).

- userLogin, SecurityUtils.java. , , .

+4

All Articles