将Spring MVC,Hibernate JPA应用程序转换为MongoDB应用程序

时间:2016-10-22 13:44:56

标签: mongodb jpa

是否有更简单的方法将我的所有hibernate JPA应用程序转换为mongodb应用程序。因为我的所有实体都是这样的

@Entity

@Table(name =“users”) public class User实现Serializable {

private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Long id;
@Column(name = "user_name")
private String userName;
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Column(name = "email")
private String email;
@Column(name = "password")
private String password;
@Column(name = "DEVICE_KEY")
private String deviceKey;
@Column(name = "status")
@Enumerated(EnumType.ORDINAL)
private MasterDataStatus status;

@Column(name = "password_history")
private int passwordHistory;

/*
 * Set
 */
@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
private Set<PasswordHistory> passwordHistories = new HashSet<PasswordHistory>();

0 个答案:

没有答案