I have the following java class:
package domain;
//imports
@Entity
public class User {
@Id @GeneratedValue
private long id;
private String name;
private String password;
private String mail;
//Getters, Setters and Constructors
}
When I change the file extension to .groovy, the application stops working. In fact it throws this stacktrace:
org.springframework.dao.InvalidDataAccessApiUsageException: Unknown entity: domain.User; nested exception is java.lang.IllegalArgumentException: Unknown entity: domain.User
I'm reading this book and the author states that any groovy class can take the place of a java class just changing its extension. So why does spring and JPA don't recognize my groovy class?
Has anyone used this technologies successfully?