parent
c6e0894bcc
commit
d168407882
@ -0,0 +1,59 @@ |
||||
package com.app.bean; |
||||
|
||||
import javax.persistence.*; |
||||
import java.util.Objects; |
||||
|
||||
@Entity |
||||
@Table(name = "refuse_apply", schema = "dbo", catalog = "gzf") |
||||
public class RefuseApply { |
||||
private Integer id; |
||||
private Integer applyId; |
||||
private String content; |
||||
|
||||
@Id |
||||
@Column(name = "id") |
||||
@SequenceGenerator(name="increment") |
||||
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||
public Integer getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Integer id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
@Basic |
||||
@Column(name = "apply_id") |
||||
public Integer getApplyId() { |
||||
return applyId; |
||||
} |
||||
|
||||
public void setApplyId(Integer applyId) { |
||||
this.applyId = applyId; |
||||
} |
||||
|
||||
@Basic |
||||
@Column(name = "content") |
||||
public String getContent() { |
||||
return content; |
||||
} |
||||
|
||||
public void setContent(String content) { |
||||
this.content = content; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object o) { |
||||
if (this == o) return true; |
||||
if (o == null || getClass() != o.getClass()) return false; |
||||
RefuseApply that = (RefuseApply) o; |
||||
return Objects.equals(id, that.id) && |
||||
Objects.equals(applyId, that.applyId) && |
||||
Objects.equals(content, that.content); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
return Objects.hash(id, applyId, content); |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.app.service; |
||||
|
||||
import com.app.bean.RefuseApply; |
||||
|
||||
public interface RefuseApplyService { |
||||
boolean save(RefuseApply refuseApply); |
||||
} |
@ -0,0 +1,28 @@ |
||||
package com.app.service; |
||||
|
||||
import com.app.bean.RefuseApply; |
||||
import org.apache.log4j.Logger; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.orm.hibernate3.HibernateTemplate; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@Service |
||||
public class RefuseApplyServiceImpl implements RefuseApplyService{ |
||||
|
||||
private static final Logger logger= Logger.getLogger(RefuseApplyServiceImpl.class); |
||||
|
||||
@Autowired |
||||
private HibernateTemplate hibernateTemplate; |
||||
|
||||
@Override |
||||
public boolean save(RefuseApply refuseApply) { |
||||
try { |
||||
hibernateTemplate.save(refuseApply); |
||||
return true; |
||||
} catch (Exception e) { |
||||
e.printStackTrace(); |
||||
logger.error(e); |
||||
return false; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue