Spring Boot Java: не могу найти символJAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Spring Boot Java: не могу найти символ

Сообщение Anonymous »

Я в новом обучающемся
Может кто-нибудь мне помочь... Я следовал этому руководству, но все равно получаю сообщение об ошибке.
Я следовал за каждым шагом, давал те же имена файлов, переменные остались теми же. какую ошибку я делаю, не могу преодолеть

package com.example.demo.dto;

//import com.example.demo.model.Address;
//import com.example.demo.model.Credential;
//import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.persistence.*;
import lombok.*;

import java.io.Serializable;
import java.util.Set;

@NoArgsConstructor
@AllArgsConstructor
@Builder
@Setter
@Getter

public class UserDto implements Serializable {

private static final long serialVersionUID = 1L;

private Integer userId;
private String firstName;
private String lastName;
private String email;
private String phone;

private Set addressDtos;

@JsonProperty("credential")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
private CredentialDatato credentialDto;

}

package com.example.demo.helper;

import com.example.demo.dto.UserDto;
import com.example.demo.model.Credential;
import com.example.demo.model.User;
import org.springframework.beans.BeanUtils;
//import com.example.demo.model.User;

public interface UserMappingHelper {

public static UserDto map(User user) {
return null;
}

public static User map(UserDto userDto) {
if(userDto == null)
{
return null;
}
User user = new User();
BeanUtils.copyProperties(userDto,user);

if(userDto.getCredentialDto() != null)
{
Credential credential = new Credential();
BeanUtils.copyProperties(userDto.getCredentialDto(),credential);

credential.setUser(user);
user.setCredential(credential);
}
return user;

}

}

вот результат.
C:\Users\User\Downloads\Spring_microservice\demo\src\main\java\com\example\demo\helper\UserMappingHelper.java:23:23
java: cannot find symbol
symbol: method getCredentialDto()
location: variable userDto of type com.example.demo.dto.UserDto


Подробнее здесь: https://stackoverflow.com/questions/792 ... ind-symbol
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»