Search in sources :

Example 1 with PrePersist

use of jakarta.persistence.PrePersist in project wildfly by wildfly.

the class LastUpdateListener method setLastUpdate.

@PreUpdate
@PrePersist
public void setLastUpdate(Cat o) {
    o.setLastUpdate(new Date());
    o.setManualVersion(o.getManualVersion() + 1);
}
Also used : Date(java.util.Date) PrePersist(jakarta.persistence.PrePersist) PreUpdate(jakarta.persistence.PreUpdate)

Example 2 with PrePersist

use of jakarta.persistence.PrePersist in project hibernate-orm by hibernate.

the class LastUpdateListener method setLastUpdate.

@PreUpdate
@PrePersist
public void setLastUpdate(Cat o) {
    o.setLastUpdate(new Date());
    o.setManualVersion(o.getManualVersion() + 1);
}
Also used : Date(java.util.Date) PrePersist(jakarta.persistence.PrePersist) PreUpdate(jakarta.persistence.PreUpdate)

Example 3 with PrePersist

use of jakarta.persistence.PrePersist in project tessera by ConsenSys.

the class EncryptedTransactionListener method onSave.

@PrePersist
public void onSave(EncryptedTransaction encryptedTransaction) {
    LOGGER.debug("onSave {}", encryptedTransaction);
    final EncodedPayload encodedPayload = encryptedTransaction.getPayload();
    final EncodedPayloadCodec encodedPayloadCodec = EncodedPayloadCodec.current();
    final PayloadEncoder payloadEncoder = PayloadEncoder.create(encodedPayloadCodec);
    final byte[] encodedPayloadData = payloadEncoder.encode(encodedPayload);
    encryptedTransaction.setEncodedPayloadCodec(encodedPayloadCodec);
    encryptedTransaction.setEncodedPayload(encodedPayloadData);
}
Also used : PayloadEncoder(com.quorum.tessera.enclave.PayloadEncoder) EncodedPayload(com.quorum.tessera.enclave.EncodedPayload) EncodedPayloadCodec(com.quorum.tessera.enclave.EncodedPayloadCodec) PrePersist(jakarta.persistence.PrePersist)

Aggregations

PrePersist (jakarta.persistence.PrePersist)3 PreUpdate (jakarta.persistence.PreUpdate)2 Date (java.util.Date)2 EncodedPayload (com.quorum.tessera.enclave.EncodedPayload)1 EncodedPayloadCodec (com.quorum.tessera.enclave.EncodedPayloadCodec)1 PayloadEncoder (com.quorum.tessera.enclave.PayloadEncoder)1