0

Is there a simpler way to convert all my hibernate JPA application to mongodb application. Because all my entities like this

@Entity

@Table(name = "users") public class User implements 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>();
devrim
  • 307
  • 1
  • 3
  • 8
  • could you please take a look at http://stackoverflow.com/questions/2153195/hibernate-with-mongodb – Satya Oct 22 '16 at 13:47
  • I read it a few hours ago and it shown me pretty hard to make my appllication available for mongodb. I have tens of entities and most of them mapped to others. – devrim Oct 22 '16 at 14:01
  • in the same answer it mentions kundera and morphia, have you checked them as well – Satya Oct 22 '16 at 14:13
  • I prefer not to add a third party. Well done, which one is more wise for a mongodb app? Defining entities with "Document" annotation and its relations "DBRef" or Defining entities with "Entity" annotation and its relations "ElementCollection or OneToMany"? – devrim Oct 23 '16 at 12:33

0 Answers0