Home > Back-end >  JPA entity class corresponding to the mysql fields in the table
JPA entity class corresponding to the mysql fields in the table

Time:05-16

Question is like this, I need to find out in the table contact_name, company_name and Email fields, but I used when creating entity class he must let me add Id field, and with it, I want only when the custom check the three not yet, he must let me Id also found out, I once plus Id the SQL statement is wrong, because my side there is a lot of contact_name, bosses, please how to break this? Thank you
Entity classes:
@ Data
@ the Entity
@ Table (name="telecommunication")
Public class KorahEmailCusotmer {
@ Id
Private String id;
@ the Column (name="contact_name")
private String name;
@ the Column (name="Email")
private String email;
@ the Column (name="company_name")
Private String CompanyName;



Public void setId (String id) {
this.id=id;
}

Public String getId () {
return id;
}
}

Public interface KorahEmailDAO extends JpaRepository JpaSpecificationExecutor {
@ Query (nativeQuery=true, value="HTTP://https://bbs.csdn.net/topics/select distinct contact_name, company_name, Email" +
"From telecommunication \ n +"
"Where send_times!=1 and send_times!=- 2 \ n + "
"Limit? ;" )
List GetUserByEmail (Integer number);
}

CodePudding user response:

Select id, contact_name, company_name, Email +
""From telecommunication

CodePudding user response:

I this table some contact_name, company_name and email with the same data, I need to go to,
  • Related