Update hibernate interceptor
Remove post flush simpan history login user
This commit is contained in:
parent
621581079c
commit
4b7a38e16f
@ -1,21 +1,17 @@
|
||||
package com.jasamedika.medifirst2000.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jasamedika.medifirst2000.entities.HistoryLoginUser;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.jasamedika.medifirst2000.entities.HistoryLoginUser;
|
||||
import java.util.List;
|
||||
|
||||
@Repository("historyLoginUserDao")
|
||||
public interface HistoryLoginUserDao extends JpaRepository<HistoryLoginUser, Integer> {
|
||||
|
||||
Page<HistoryLoginUser> findByHistoryLoginId(Integer historyLoginId, Pageable pageable);
|
||||
|
||||
List<HistoryLoginUser> findByHistoryLoginId(Integer historyLoginId);
|
||||
|
||||
|
||||
|
||||
Page<HistoryLoginUser> findByHistoryLoginId(Integer historyLoginId, Pageable pageable);
|
||||
|
||||
List<HistoryLoginUser> findByHistoryLoginId(Integer historyLoginId);
|
||||
}
|
||||
|
||||
@ -1,35 +1,26 @@
|
||||
package com.jasamedika.medifirst2000.logging.hibernate.interceptor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Iterator;
|
||||
import com.jasamedika.medifirst2000.logging.hibernate.holder.HibernateInterceptorBeansHolder;
|
||||
|
||||
import org.hibernate.CallbackException;
|
||||
import org.hibernate.EmptyInterceptor;
|
||||
import org.hibernate.type.Type;
|
||||
|
||||
import com.jasamedika.medifirst2000.logging.hibernate.holder.HibernateInterceptorBeansHolder;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Syamsu
|
||||
*/
|
||||
|
||||
//@Component
|
||||
public class HibernateInterceptor extends EmptyInterceptor {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 5478574918838397131L;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState,
|
||||
String[] propertyNames, Type[] types) {
|
||||
HibernateInterceptorBeansHolder.loggingSystemAsynchronous.pushData(entity, id, currentState, previousState, propertyNames, types);
|
||||
HibernateInterceptorBeansHolder.loggingSystemAsynchronous.pushData(entity, id, currentState, previousState,
|
||||
propertyNames, types);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
|
||||
@ -37,13 +28,8 @@ public class HibernateInterceptor extends EmptyInterceptor {
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public void onDelete(
|
||||
Object entity,
|
||||
Serializable id,
|
||||
Object[] state,
|
||||
String[] propertyNames,
|
||||
Type[] types) {
|
||||
|
||||
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
|
||||
HibernateInterceptorBeansHolder.loggingSystemAsynchronous.deleteData(entity, id, state, propertyNames, types);
|
||||
}
|
||||
|
||||
@ -56,10 +42,14 @@ public class HibernateInterceptor extends EmptyInterceptor {
|
||||
HibernateInterceptorBeansHolder.loggingSystemAsynchronous.saveOperationLog(sql);
|
||||
return sql;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postFlush(Iterator entities) throws CallbackException {
|
||||
HibernateInterceptorBeansHolder.loggingSystemAsynchronous.save(entities);
|
||||
}
|
||||
|
||||
/*
|
||||
* Commented by Salman 2024/01/30
|
||||
*
|
||||
* @Desc: Logging sudah tidak dipakai, migrasi ke laravel
|
||||
*/
|
||||
// @Override
|
||||
// public void postFlush(Iterator entities) throws CallbackException {
|
||||
// HibernateInterceptorBeansHolder.loggingSystemAsynchronous.save(entities);
|
||||
// }
|
||||
}
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
package com.jasamedika.medifirst2000.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.jasamedika.medifirst2000.entities.HistoryLoginUser;
|
||||
import com.jasamedika.medifirst2000.vo.HistoryLoginUserVO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface HistoryLoginUserService<T> extends BaseVoService<HistoryLoginUser, HistoryLoginUserVO, Integer> {
|
||||
|
||||
|
||||
Map<String, Object> findByHistoryLoginId(Integer historyLoginId);
|
||||
Map<String, Object> findByHistoryLoginId(Integer historyLoginId, Integer page, Integer limit, String sort, String dir);
|
||||
|
||||
Map<String, Object> findByHistoryLoginId(Integer historyLoginId, Integer page, Integer limit, String sort,
|
||||
String dir);
|
||||
}
|
||||
|
||||
@ -1,142 +1,68 @@
|
||||
package com.jasamedika.medifirst2000.entities;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.jasamedika.medifirst2000.base.BaseMaster;
|
||||
import com.jasamedika.medifirst2000.helper.Caption;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
import static javax.persistence.FetchType.LAZY;
|
||||
import static javax.persistence.GenerationType.SEQUENCE;
|
||||
|
||||
/**
|
||||
* class HistoryLoginUser
|
||||
*
|
||||
* @author Generator
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "HistoryLoginUser_S")
|
||||
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
|
||||
public class HistoryLoginUser extends BaseMaster {
|
||||
private static final long serialVersionUID = -8555810951596017573L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.historyloginuser_m_id_seq")
|
||||
@javax.persistence.SequenceGenerator(name = "public.historyloginuser_m_id_seq", sequenceName = "public.historyloginuser_m_id_seq", allocationSize = 1)
|
||||
@GeneratedValue(strategy = SEQUENCE, generator = "public.historyloginuser_m_id_seq")
|
||||
@SequenceGenerator(name = "public.historyloginuser_m_id_seq", sequenceName = "public.historyloginuser_m_id_seq", allocationSize = 1)
|
||||
@Column(name = "id")
|
||||
protected Integer id;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Column(name = "DetailDataCRUD", nullable = true)
|
||||
@Column(name = "DetailDataCRUD")
|
||||
@Caption(value = "Detail Data C R U D")
|
||||
private String detailDataCRUD;
|
||||
|
||||
public void setDetailDataCRUD(String detailDataCRUD) {
|
||||
this.detailDataCRUD = detailDataCRUD;
|
||||
}
|
||||
|
||||
public String getDetailDataCRUD() {
|
||||
return this.detailDataCRUD;
|
||||
}
|
||||
|
||||
@Column(name = "isCRUD", nullable = false, length = 1)
|
||||
@Caption(value = "Is C R U D")
|
||||
private String isCRUD;
|
||||
|
||||
public void setIsCRUD(String isCRUD) {
|
||||
this.isCRUD = isCRUD;
|
||||
}
|
||||
|
||||
public String getIsCRUD() {
|
||||
return this.isCRUD;
|
||||
}
|
||||
|
||||
|
||||
@Column(name = "NamaObjekCRUD", nullable = true, length = 255)
|
||||
@Column(name = "NamaObjekCRUD")
|
||||
@Caption(value = "Nama Objek C R U D")
|
||||
private String namaObjekCRUD;
|
||||
|
||||
public void setNamaObjekCRUD(String namaObjekCRUD) {
|
||||
this.namaObjekCRUD = namaObjekCRUD;
|
||||
}
|
||||
|
||||
public String getNamaObjekCRUD() {
|
||||
return this.namaObjekCRUD;
|
||||
}
|
||||
|
||||
@NotNull(message = "No Record tidak boleh kosong")
|
||||
@Column(name = "NoRecord", nullable = false, length = 50)
|
||||
@NotNull(message = "No Record tidak boleh kosong")
|
||||
@Caption(value = "No Record")
|
||||
private String noRecord;
|
||||
|
||||
public void setNoRecord(String noRecord) {
|
||||
this.noRecord = noRecord;
|
||||
}
|
||||
|
||||
public String getNoRecord() {
|
||||
return this.noRecord;
|
||||
}
|
||||
|
||||
@Column(name = "TglCRUDin", nullable = true)
|
||||
@Column(name = "TglCRUDin")
|
||||
@Caption(value = "Tanggal C R U Din")
|
||||
private Date tglCRUDin;
|
||||
|
||||
public void setTglCRUDin(Date tglCRUDin) {
|
||||
this.tglCRUDin = tglCRUDin;
|
||||
}
|
||||
|
||||
public Date getTglCRUDin() {
|
||||
return this.tglCRUDin;
|
||||
}
|
||||
|
||||
@Column(name = "TglCRUDout", nullable = true)
|
||||
@Column(name = "TglCRUDout")
|
||||
@Caption(value = "Tanggal C R U Dout")
|
||||
private Date tglCRUDout;
|
||||
|
||||
public void setTglCRUDout(Date tglCRUDout) {
|
||||
this.tglCRUDout = tglCRUDout;
|
||||
}
|
||||
|
||||
public Date getTglCRUDout() {
|
||||
return this.tglCRUDout;
|
||||
}
|
||||
|
||||
|
||||
@ManyToOne
|
||||
@ManyToOne(fetch = LAZY)
|
||||
@JoinColumn(name = "ObjectHistoryLoginFk")
|
||||
@NotNull(message = "Kd History Login tidak boleh kosong")
|
||||
@Caption(value = "Object History Login")
|
||||
private HistoryLoginModulAplikasi historyLoginModulAplikasi;
|
||||
|
||||
public void setHistoryLoginModulAplikasi(HistoryLoginModulAplikasi historyLoginModulAplikasi) {
|
||||
this.historyLoginModulAplikasi = historyLoginModulAplikasi;
|
||||
}
|
||||
|
||||
public HistoryLoginModulAplikasi getHistoryLoginModulAplikasi() {
|
||||
return this.historyLoginModulAplikasi;
|
||||
}
|
||||
|
||||
@Column(name = "ObjectHistoryLoginFk", insertable = false, updatable = false)
|
||||
private Integer historyLoginId;
|
||||
|
||||
public void setHistoryLoginId(Integer historyLoginId){
|
||||
this.historyLoginId = historyLoginId;
|
||||
}
|
||||
|
||||
public Integer getHistoryLoginId(){
|
||||
return historyLoginId;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,101 +1,33 @@
|
||||
package com.jasamedika.medifirst2000.vo;
|
||||
|
||||
import com.jasamedika.medifirst2000.base.vo.BaseMasterVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.jasamedika.medifirst2000.base.vo.BaseMasterVO;
|
||||
|
||||
/**
|
||||
* class HistoryLoginUser
|
||||
* class HistoryLoginUser
|
||||
*
|
||||
* @author Generator
|
||||
*/
|
||||
@JsonInclude(Include.ALWAYS)
|
||||
@Getter
|
||||
@Setter
|
||||
public class HistoryLoginUserVO extends BaseMasterVO {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -6774220356263220981L;
|
||||
|
||||
private String detailDataCRUD;
|
||||
|
||||
private String isCRUD;
|
||||
|
||||
public void setIsCRUD(String isCRUD) {
|
||||
this.isCRUD = isCRUD;
|
||||
}
|
||||
|
||||
public String getIsCRUD(){
|
||||
return this.isCRUD;
|
||||
}
|
||||
|
||||
private HistoryLoginModulAplikasiVO historyLogin;
|
||||
|
||||
public void setHistoryLogin(HistoryLoginModulAplikasiVO historyLogin) {
|
||||
this.historyLogin = historyLogin;
|
||||
}
|
||||
|
||||
public HistoryLoginModulAplikasiVO getHistoryLogin(){
|
||||
return this.historyLogin;
|
||||
}
|
||||
|
||||
public Integer getHistoryLoginId() {
|
||||
return historyLoginId;
|
||||
}
|
||||
|
||||
public void setHistoryLoginId(Integer historyLoginId) {
|
||||
this.historyLoginId = historyLoginId;
|
||||
}
|
||||
|
||||
private Integer historyLoginId;
|
||||
|
||||
private String namaObjekCRUD;
|
||||
|
||||
public void setNamaObjekCRUD(String namaObjekCRUD) {
|
||||
this.namaObjekCRUD = namaObjekCRUD;
|
||||
}
|
||||
|
||||
public String getNamaObjekCRUD(){
|
||||
return this.namaObjekCRUD;
|
||||
}
|
||||
|
||||
private String noRecord;
|
||||
|
||||
public void setNoRecord(String noRecord) {
|
||||
this.noRecord = noRecord;
|
||||
}
|
||||
|
||||
public String getNoRecord(){
|
||||
return this.noRecord;
|
||||
}
|
||||
|
||||
private Date tglCRUDin;
|
||||
|
||||
public void setTglCRUDin(Date tglCRUDin) {
|
||||
this.tglCRUDin = tglCRUDin;
|
||||
}
|
||||
|
||||
public Date getTglCRUDin(){
|
||||
return this.tglCRUDin;
|
||||
}
|
||||
|
||||
private Date tglCRUDout;
|
||||
|
||||
public void setTglCRUDout(Date tglCRUDout) {
|
||||
this.tglCRUDout = tglCRUDout;
|
||||
}
|
||||
|
||||
public Date getTglCRUDout(){
|
||||
return this.tglCRUDout;
|
||||
}
|
||||
|
||||
public String getDetailDataCRUD() {
|
||||
return detailDataCRUD;
|
||||
}
|
||||
|
||||
public void setDetailDataCRUD(String detailDataCRUD) {
|
||||
this.detailDataCRUD = detailDataCRUD;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user