Spring Data JPA Mapping Exception没有JDBC类型的Dialect映射:-9

时间:2017-07-11 19:45:44

标签: spring hibernate jpa jdbc

我正在尝试使用投影,并收到以下错误。不确定是什么问题。

以下是投影:

public interface UserMini {

    Long getApproverKey();
    String getEmailAddress();
    String getFirstName();
    String getLastName();
    Long getUserKey();
    String getUserName();

}

这是存储库中的查询:

@RestResource(path="getUserMini")
@Query(value="SELECT approverKey, emailAddress, firstName, lastName, userKey, userName  FROM [dbo].BdmUser WHERE userKey = :userKey ", nativeQuery=true)
UserMini getUserMini(@Param("userKey") long userKey);

这是实体

@Table (name="[BdmUser]")
@Entity
public class BdmUser {

@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long    userKey;

private Long    priceListKey;
private String  firstName;
private String  lastName;
private String  userName;
private String  emailAddress;
private String  password;
private Boolean active;
private Long    approverKey;
private BigDecimal  orderLimit;
private Long    salesOfficeKey;
private Long    reportsToId;
private Boolean requiresOrderApproval;
private Date    lastLoginDate;
private String rowIsCurrent;
private Date rowStartDate;
private Date rowEndDate;

@Column(name="HashByteValueType1", updatable=false, insertable=false)   
private String  hashByteValueType1;
@Column(name="HashByteValueType2", updatable=false, insertable=false)   
private String  hashByteValueType2;
private String  rowChangeReason;
@Column(name="DQScoreKey")
private Integer     dqScoreKey;
private Integer     insertAuditKey;
private Integer     updateAuditKey;

1 个答案:

答案 0 :(得分:0)

尝试在查询中将NVARCHAR强制转换为VARCHAR

services.Configure<FormOptions>(options =>
{
    options.MultipartBodyLengthLimit = 100000000;
});