0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【トラブル】Spring BootでMyBatisを使おうとしたらTimestampのカラムでエラーが出る

Last updated at Posted at 2025-06-03

SpringBootのMyBatisで以下のようなエラーが発生しました

Caused by: java.lang.IllegalStateException: No typehandler found for property createdAt

こちらがそのDomainになります

package com.example.demo.domain;

import java.security.Timestamp;

import lombok.Data;

@Data
public class Employee {
	int id;
	String name;
	String jobCategory;
	String jobCategoryName;
	Timestamp createdAt;
	Timestamp updatedAt;
}

こちらが正しいDomainです。

package com.example.demo.domain;

import java.sql.Timestamp;

import lombok.Data;

@Data
public class Employee {
	int id;
	String name;
	String jobCategory;
	String jobCategoryName;
	Timestamp createdAt;
	Timestamp updatedAt;
}

java.sql.TimestampでTimestampを定義していないと発生するようです。
ややこしいですね(;^ω^)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?