Skip to content

Instantly share code, notes, and snippets.

View srigalamilitan's full-sized avatar
🌴
On vacation

krisna putra srigalamilitan

🌴
On vacation
View GitHub Profile
@srigalamilitan
srigalamilitan / OrderTransaction.java
Created August 26, 2015 04:33
Hib5Java8DateTime
@Entity
@Table(name = "order_transaction")
@Data
public class OrderTransaction {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long orderId;
private String OrderProduct;
private LocalDate orderDate;
@srigalamilitan
srigalamilitan / pom.xml
Last active August 26, 2015 06:16
Hib5Java8DateTime
.......
<properties>
<hibernate.version>5.0.0.Final</hibernate.version>
<mysql.version>5.1.36</mysql.version>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
@srigalamilitan
srigalamilitan / hibernate-java8.xml
Created August 26, 2015 04:37
Hib5Java8DateTime
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-java8</artifactId>
<version>${hibernate.version}</version>
</dependency>
@srigalamilitan
srigalamilitan / order_transaction.sql
Created August 26, 2015 06:13
Hib5Java8DateTime
CREATE TABLE `order_transaction` (
`orderId` bigint(20) NOT NULL AUTO_INCREMENT,
`OrderProduct` varchar(255) DEFAULT NULL,
`orderCreated` timestamp NULL DEFAULT NULL,
`orderDate` date DEFAULT NULL,
`orderTime` time DEFAULT NULL,
PRIMARY KEY (`orderId`)
)
@srigalamilitan
srigalamilitan / Main.java
Created August 26, 2015 06:18
Hib5Java8DateTime
public static void main(String[] args) {
EntityManager em =PersistenceManager.INSTANCE.getEntityManager();
em.getTransaction().begin();
for (int i = 0; i < 10; i++) {
OrderTransaction order=new OrderTransaction();
order.setOrderProduct("Computer No "+i);
//Date With LocalDate
order.setOrderDate(LocalDate.now());
//Time With LocalTime
order.setOrderTime(LocalTime.now());
@srigalamilitan
srigalamilitan / Kembalian.java
Created September 15, 2015 06:17
Kembalian Pecahan Dalam Indonesia
public class Kembalian{
public static void pecahUang(Long nilai){
Long _nilai=nilai;
/*Nilai Pecahan Indonesia*/
Long _100rb=100000L;
Long _50rb =50000L;
Long _20rb =20000L;
Long _10rb = 10000L;
@srigalamilitan
srigalamilitan / Pembulatan.java
Created September 17, 2015 01:28
Pembulatan 1000
import java.math.RoundingMode;
import java.math.BigDecimal;
public class Pembulatan
{
public static int pembulatan1000( int nilai ){
BigDecimal _value = new BigDecimal( (double)nilai/1000);
_value= _value.setScale(0,RoundingMode.UP);
return _value.intValue()*1000;
}
public static void main(String []args){
@srigalamilitan
srigalamilitan / pom.xml
Created October 13, 2015 17:39
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mongodb</groupId>
<artifactId>spark-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>M101J</name>
@Override
public Map<String, Object> sendNotif(List<RequestEmailNotifHelper>requests) {
try {
//TODO: open remark after ready to implemented
HashMap<String, Object> param = new HashMap<>() ;
param.put(IEmailNotifConstans.IMailParamJson.TEMPLATE_ID,4568);
@Override
public Map<String, Object> sendNotif(List<RequestEmailNotifHelper>requests) {
try {
//TODO: open remark after ready to implemented
HashMap<String, Object> param = new HashMap<>() ;
param.put(IEmailNotifConstans.IMailParamJson.TEMPLATE_ID,4568);