// Path: app/src/main/java/com/vsahin/moneycim/Model/Database/Converters.java
// public class Converters {
//     @TypeConverter
//     public static Date fromTimestamp(Long value) {
//         return value == null ? null : new Date(value);
//     }
// 
//     @TypeConverter
//     public static Long dateToTimestamp(Date date) {
//         return date == null ? null : date.getTime();
//     }
// }


import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;
import com.vsahin.moneycim.Model.Database.Converters;
import java.io.Serializable;
import java.util.Date;

package com.vsahin.moneycim.Model.Entity;




/**
 * Created by Volkan Şahin on 18.08.2017.
 */

@Entity(tableName = "spending")
public class RawSpending implements Serializable {

    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "id")
    public int id;

    @ForeignKey(entity = SpendingGroup.class, parentColumns = "group-id", childColumns = "group-id")
    @ColumnInfo(name = "group_id")
    private int groupId;


// Path: app/src/main/java/com/vsahin/moneycim/Model/Database/Converters.java
// public class Converters {
//     @TypeConverter
//     public static Date fromTimestamp(Long value) {
//         return value == null ? null : new Date(value);
//     }
// 
//     @TypeConverter
//     public static Long dateToTimestamp(Date date) {
//         return date == null ? null : date.getTime();
//     }
// }


// Path: app/src/main/java/com/vsahin/moneycim/Model/Entity/RawSpending.java
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;
import com.vsahin.moneycim.Model.Database.Converters;
import java.io.Serializable;
import java.util.Date;

package com.vsahin.moneycim.Model.Entity;




/**
 * Created by Volkan Şahin on 18.08.2017.
 */

@Entity(tableName = "spending")
public class RawSpending implements Serializable {

    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "id")
    public int id;

    @ForeignKey(entity = SpendingGroup.class, parentColumns = "group-id", childColumns = "group-id")
    @ColumnInfo(name = "group_id")
    private int groupId;


    @TypeConverters(Converters.class)
