/* stats-entry.c generated by valac 0.56.19, the Vala compiler
 * generated from stats-entry.vala, do not modify */

/*
 * Copyright (c) 2025 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "ft_core.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
#include <gom/gom.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	FT_STATS_ENTRY_0_PROPERTY,
	FT_STATS_ENTRY_ID_PROPERTY,
	FT_STATS_ENTRY_TIME_PROPERTY,
	FT_STATS_ENTRY_DATE_PROPERTY,
	FT_STATS_ENTRY_OFFSET_PROPERTY,
	FT_STATS_ENTRY_DURATION_PROPERTY,
	FT_STATS_ENTRY_CATEGORY_PROPERTY,
	FT_STATS_ENTRY_SOURCE_ID_PROPERTY,
	FT_STATS_ENTRY_NUM_PROPERTIES
};
static GParamSpec* ft_stats_entry_properties[FT_STATS_ENTRY_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	FT_AGGREGATED_STATS_ENTRY_0_PROPERTY,
	FT_AGGREGATED_STATS_ENTRY_ID_PROPERTY,
	FT_AGGREGATED_STATS_ENTRY_DATE_PROPERTY,
	FT_AGGREGATED_STATS_ENTRY_CATEGORY_PROPERTY,
	FT_AGGREGATED_STATS_ENTRY_DURATION_PROPERTY,
	FT_AGGREGATED_STATS_ENTRY_COUNT_PROPERTY,
	FT_AGGREGATED_STATS_ENTRY_NUM_PROPERTIES
};
static GParamSpec* ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_NUM_PROPERTIES];

struct _FtStatsEntryPrivate {
	gint64 _id;
	gint64 _time;
	gchar* _date;
	gint64 _offset;
	gint64 _duration;
	gchar* _category;
	gint64 _source_id;
};

struct _FtAggregatedStatsEntryPrivate {
	gint64 _id;
	gchar* _date;
	gchar* _category;
	gint64 _duration;
	gint64 _count;
};

static gint FtStatsEntry_private_offset;
static gpointer ft_stats_entry_parent_class = NULL;
static gint FtAggregatedStatsEntry_private_offset;
static gpointer ft_aggregated_stats_entry_parent_class = NULL;

static void ft_stats_entry_finalize (GObject * obj);
static GType ft_stats_entry_get_type_once (void);
static void _vala_ft_stats_entry_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_ft_stats_entry_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);
static void ft_aggregated_stats_entry_finalize (GObject * obj);
static GType ft_aggregated_stats_entry_get_type_once (void);
static void _vala_ft_aggregated_stats_entry_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_ft_aggregated_stats_entry_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
ft_stats_entry_get_instance_private (FtStatsEntry* self)
{
	return G_STRUCT_MEMBER_P (self, FtStatsEntry_private_offset);
}

FtStatsEntry*
ft_stats_entry_copy (FtStatsEntry* self)
{
	gint64 _tmp0_;
	gint64 _tmp1_;
	const gchar* _tmp2_;
	gint64 _tmp3_;
	gint64 _tmp4_;
	const gchar* _tmp5_;
	gint64 _tmp6_;
	GObject* _tmp7_;
	GObject* _tmp8_;
	FtStatsEntry* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id;
	_tmp1_ = self->priv->_time;
	_tmp2_ = self->priv->_date;
	_tmp3_ = self->priv->_offset;
	_tmp4_ = self->priv->_duration;
	_tmp5_ = self->priv->_category;
	_tmp6_ = self->priv->_source_id;
	_tmp7_ = g_object_new (FT_TYPE_STATS_ENTRY, "id", _tmp0_, "time", _tmp1_, "date", _tmp2_, "offset", _tmp3_, "duration", _tmp4_, "category", _tmp5_, "source-id", _tmp6_, NULL);
	_tmp8_ = G_IS_INITIALLY_UNOWNED (_tmp7_) ? g_object_ref_sink (_tmp7_) : _tmp7_;
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, FT_TYPE_STATS_ENTRY, FtStatsEntry);
	return result;
}

FtStatsEntry*
ft_stats_entry_construct (GType object_type)
{
	FtStatsEntry * self = NULL;
	self = (FtStatsEntry*) g_object_new (object_type, NULL);
	return self;
}

FtStatsEntry*
ft_stats_entry_new (void)
{
	return ft_stats_entry_construct (FT_TYPE_STATS_ENTRY);
}

gint64
ft_stats_entry_get_id (FtStatsEntry* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_id;
	return result;
}

void
ft_stats_entry_set_id (FtStatsEntry* self,
                       gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_stats_entry_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, ft_stats_entry_properties[FT_STATS_ENTRY_ID_PROPERTY]);
	}
}

gint64
ft_stats_entry_get_time (FtStatsEntry* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_time;
	return result;
}

void
ft_stats_entry_set_time (FtStatsEntry* self,
                         gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_stats_entry_get_time (self);
	if (old_value != value) {
		self->priv->_time = value;
		g_object_notify_by_pspec ((GObject *) self, ft_stats_entry_properties[FT_STATS_ENTRY_TIME_PROPERTY]);
	}
}

const gchar*
ft_stats_entry_get_date (FtStatsEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_date;
	result = _tmp0_;
	return result;
}

void
ft_stats_entry_set_date (FtStatsEntry* self,
                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_stats_entry_get_date (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_date);
		self->priv->_date = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_stats_entry_properties[FT_STATS_ENTRY_DATE_PROPERTY]);
	}
}

gint64
ft_stats_entry_get_offset (FtStatsEntry* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_offset;
	return result;
}

void
ft_stats_entry_set_offset (FtStatsEntry* self,
                           gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_stats_entry_get_offset (self);
	if (old_value != value) {
		self->priv->_offset = value;
		g_object_notify_by_pspec ((GObject *) self, ft_stats_entry_properties[FT_STATS_ENTRY_OFFSET_PROPERTY]);
	}
}

gint64
ft_stats_entry_get_duration (FtStatsEntry* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_duration;
	return result;
}

void
ft_stats_entry_set_duration (FtStatsEntry* self,
                             gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_stats_entry_get_duration (self);
	if (old_value != value) {
		self->priv->_duration = value;
		g_object_notify_by_pspec ((GObject *) self, ft_stats_entry_properties[FT_STATS_ENTRY_DURATION_PROPERTY]);
	}
}

const gchar*
ft_stats_entry_get_category (FtStatsEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_category;
	result = _tmp0_;
	return result;
}

void
ft_stats_entry_set_category (FtStatsEntry* self,
                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_stats_entry_get_category (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_category);
		self->priv->_category = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_stats_entry_properties[FT_STATS_ENTRY_CATEGORY_PROPERTY]);
	}
}

gint64
ft_stats_entry_get_source_id (FtStatsEntry* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_source_id;
	return result;
}

void
ft_stats_entry_set_source_id (FtStatsEntry* self,
                              gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_stats_entry_get_source_id (self);
	if (old_value != value) {
		self->priv->_source_id = value;
		g_object_notify_by_pspec ((GObject *) self, ft_stats_entry_properties[FT_STATS_ENTRY_SOURCE_ID_PROPERTY]);
	}
}

static void
ft_stats_entry_class_init (FtStatsEntryClass * klass,
                           gpointer klass_data)
{
	ft_stats_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtStatsEntry_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_stats_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_stats_entry_set_property;
	G_OBJECT_CLASS (klass)->finalize = ft_stats_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_STATS_ENTRY_ID_PROPERTY, ft_stats_entry_properties[FT_STATS_ENTRY_ID_PROPERTY] = g_param_spec_int64 ("id", "id", "id", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_STATS_ENTRY_TIME_PROPERTY, ft_stats_entry_properties[FT_STATS_ENTRY_TIME_PROPERTY] = g_param_spec_int64 ("time", "time", "time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_STATS_ENTRY_DATE_PROPERTY, ft_stats_entry_properties[FT_STATS_ENTRY_DATE_PROPERTY] = g_param_spec_string ("date", "date", "date", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_STATS_ENTRY_OFFSET_PROPERTY, ft_stats_entry_properties[FT_STATS_ENTRY_OFFSET_PROPERTY] = g_param_spec_int64 ("offset", "offset", "offset", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_STATS_ENTRY_DURATION_PROPERTY, ft_stats_entry_properties[FT_STATS_ENTRY_DURATION_PROPERTY] = g_param_spec_int64 ("duration", "duration", "duration", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_STATS_ENTRY_CATEGORY_PROPERTY, ft_stats_entry_properties[FT_STATS_ENTRY_CATEGORY_PROPERTY] = g_param_spec_string ("category", "category", "category", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_STATS_ENTRY_SOURCE_ID_PROPERTY, ft_stats_entry_properties[FT_STATS_ENTRY_SOURCE_ID_PROPERTY] = g_param_spec_int64 ("source-id", "source-id", "source-id", G_MININT64, G_MAXINT64, (gint64) 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gom_resource_class_set_table (GOM_RESOURCE_CLASS (klass), "stats");
	gom_resource_class_set_primary_key (GOM_RESOURCE_CLASS (klass), "id");
	gom_resource_class_set_notnull (GOM_RESOURCE_CLASS (klass), "time");
	gom_resource_class_set_notnull (GOM_RESOURCE_CLASS (klass), "date");
	gom_resource_class_set_notnull (GOM_RESOURCE_CLASS (klass), "offset");
	gom_resource_class_set_notnull (GOM_RESOURCE_CLASS (klass), "category");
}

static void
ft_stats_entry_instance_init (FtStatsEntry * self,
                              gpointer klass)
{
	self->priv = ft_stats_entry_get_instance_private (self);
	self->priv->_source_id = (gint64) 0;
}

static void
ft_stats_entry_finalize (GObject * obj)
{
	FtStatsEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_STATS_ENTRY, FtStatsEntry);
	_g_free0 (self->priv->_date);
	_g_free0 (self->priv->_category);
	G_OBJECT_CLASS (ft_stats_entry_parent_class)->finalize (obj);
}

static GType
ft_stats_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtStatsEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_stats_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtStatsEntry), 0, (GInstanceInitFunc) ft_stats_entry_instance_init, NULL };
	GType ft_stats_entry_type_id;
	ft_stats_entry_type_id = g_type_register_static (gom_resource_get_type (), "FtStatsEntry", &g_define_type_info, 0);
	FtStatsEntry_private_offset = g_type_add_instance_private (ft_stats_entry_type_id, sizeof (FtStatsEntryPrivate));
	return ft_stats_entry_type_id;
}

GType
ft_stats_entry_get_type (void)
{
	static volatile gsize ft_stats_entry_type_id__once = 0;
	if (g_once_init_enter (&ft_stats_entry_type_id__once)) {
		GType ft_stats_entry_type_id;
		ft_stats_entry_type_id = ft_stats_entry_get_type_once ();
		g_once_init_leave (&ft_stats_entry_type_id__once, ft_stats_entry_type_id);
	}
	return ft_stats_entry_type_id__once;
}

static void
_vala_ft_stats_entry_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	FtStatsEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_STATS_ENTRY, FtStatsEntry);
	switch (property_id) {
		case FT_STATS_ENTRY_ID_PROPERTY:
		g_value_set_int64 (value, ft_stats_entry_get_id (self));
		break;
		case FT_STATS_ENTRY_TIME_PROPERTY:
		g_value_set_int64 (value, ft_stats_entry_get_time (self));
		break;
		case FT_STATS_ENTRY_DATE_PROPERTY:
		g_value_set_string (value, ft_stats_entry_get_date (self));
		break;
		case FT_STATS_ENTRY_OFFSET_PROPERTY:
		g_value_set_int64 (value, ft_stats_entry_get_offset (self));
		break;
		case FT_STATS_ENTRY_DURATION_PROPERTY:
		g_value_set_int64 (value, ft_stats_entry_get_duration (self));
		break;
		case FT_STATS_ENTRY_CATEGORY_PROPERTY:
		g_value_set_string (value, ft_stats_entry_get_category (self));
		break;
		case FT_STATS_ENTRY_SOURCE_ID_PROPERTY:
		g_value_set_int64 (value, ft_stats_entry_get_source_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_stats_entry_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	FtStatsEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_STATS_ENTRY, FtStatsEntry);
	switch (property_id) {
		case FT_STATS_ENTRY_ID_PROPERTY:
		ft_stats_entry_set_id (self, g_value_get_int64 (value));
		break;
		case FT_STATS_ENTRY_TIME_PROPERTY:
		ft_stats_entry_set_time (self, g_value_get_int64 (value));
		break;
		case FT_STATS_ENTRY_DATE_PROPERTY:
		ft_stats_entry_set_date (self, g_value_get_string (value));
		break;
		case FT_STATS_ENTRY_OFFSET_PROPERTY:
		ft_stats_entry_set_offset (self, g_value_get_int64 (value));
		break;
		case FT_STATS_ENTRY_DURATION_PROPERTY:
		ft_stats_entry_set_duration (self, g_value_get_int64 (value));
		break;
		case FT_STATS_ENTRY_CATEGORY_PROPERTY:
		ft_stats_entry_set_category (self, g_value_get_string (value));
		break;
		case FT_STATS_ENTRY_SOURCE_ID_PROPERTY:
		ft_stats_entry_set_source_id (self, g_value_get_int64 (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
ft_aggregated_stats_entry_get_instance_private (FtAggregatedStatsEntry* self)
{
	return G_STRUCT_MEMBER_P (self, FtAggregatedStatsEntry_private_offset);
}

FtAggregatedStatsEntry*
ft_aggregated_stats_entry_construct (GType object_type)
{
	FtAggregatedStatsEntry * self = NULL;
	self = (FtAggregatedStatsEntry*) g_object_new (object_type, NULL);
	return self;
}

FtAggregatedStatsEntry*
ft_aggregated_stats_entry_new (void)
{
	return ft_aggregated_stats_entry_construct (FT_TYPE_AGGREGATED_STATS_ENTRY);
}

gint64
ft_aggregated_stats_entry_get_id (FtAggregatedStatsEntry* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_id;
	return result;
}

void
ft_aggregated_stats_entry_set_id (FtAggregatedStatsEntry* self,
                                  gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_aggregated_stats_entry_get_id (self);
	if (old_value != value) {
		self->priv->_id = value;
		g_object_notify_by_pspec ((GObject *) self, ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_ID_PROPERTY]);
	}
}

const gchar*
ft_aggregated_stats_entry_get_date (FtAggregatedStatsEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_date;
	result = _tmp0_;
	return result;
}

void
ft_aggregated_stats_entry_set_date (FtAggregatedStatsEntry* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_aggregated_stats_entry_get_date (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_date);
		self->priv->_date = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_DATE_PROPERTY]);
	}
}

const gchar*
ft_aggregated_stats_entry_get_category (FtAggregatedStatsEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_category;
	result = _tmp0_;
	return result;
}

void
ft_aggregated_stats_entry_set_category (FtAggregatedStatsEntry* self,
                                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_aggregated_stats_entry_get_category (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_category);
		self->priv->_category = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_CATEGORY_PROPERTY]);
	}
}

gint64
ft_aggregated_stats_entry_get_duration (FtAggregatedStatsEntry* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_duration;
	return result;
}

void
ft_aggregated_stats_entry_set_duration (FtAggregatedStatsEntry* self,
                                        gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_aggregated_stats_entry_get_duration (self);
	if (old_value != value) {
		self->priv->_duration = value;
		g_object_notify_by_pspec ((GObject *) self, ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_DURATION_PROPERTY]);
	}
}

gint64
ft_aggregated_stats_entry_get_count (FtAggregatedStatsEntry* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_count;
	return result;
}

void
ft_aggregated_stats_entry_set_count (FtAggregatedStatsEntry* self,
                                     gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_aggregated_stats_entry_get_count (self);
	if (old_value != value) {
		self->priv->_count = value;
		g_object_notify_by_pspec ((GObject *) self, ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_COUNT_PROPERTY]);
	}
}

static void
ft_aggregated_stats_entry_class_init (FtAggregatedStatsEntryClass * klass,
                                      gpointer klass_data)
{
	ft_aggregated_stats_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtAggregatedStatsEntry_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_aggregated_stats_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_aggregated_stats_entry_set_property;
	G_OBJECT_CLASS (klass)->finalize = ft_aggregated_stats_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_AGGREGATED_STATS_ENTRY_ID_PROPERTY, ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_ID_PROPERTY] = g_param_spec_int64 ("id", "id", "id", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_AGGREGATED_STATS_ENTRY_DATE_PROPERTY, ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_DATE_PROPERTY] = g_param_spec_string ("date", "date", "date", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_AGGREGATED_STATS_ENTRY_CATEGORY_PROPERTY, ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_CATEGORY_PROPERTY] = g_param_spec_string ("category", "category", "category", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_AGGREGATED_STATS_ENTRY_DURATION_PROPERTY, ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_DURATION_PROPERTY] = g_param_spec_int64 ("duration", "duration", "duration", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_AGGREGATED_STATS_ENTRY_COUNT_PROPERTY, ft_aggregated_stats_entry_properties[FT_AGGREGATED_STATS_ENTRY_COUNT_PROPERTY] = g_param_spec_int64 ("count", "count", "count", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gom_resource_class_set_table (GOM_RESOURCE_CLASS (klass), "aggregatedstats");
	gom_resource_class_set_primary_key (GOM_RESOURCE_CLASS (klass), "id");
	gom_resource_class_set_notnull (GOM_RESOURCE_CLASS (klass), "date");
	gom_resource_class_set_notnull (GOM_RESOURCE_CLASS (klass), "category");
}

static void
ft_aggregated_stats_entry_instance_init (FtAggregatedStatsEntry * self,
                                         gpointer klass)
{
	self->priv = ft_aggregated_stats_entry_get_instance_private (self);
}

static void
ft_aggregated_stats_entry_finalize (GObject * obj)
{
	FtAggregatedStatsEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_AGGREGATED_STATS_ENTRY, FtAggregatedStatsEntry);
	_g_free0 (self->priv->_date);
	_g_free0 (self->priv->_category);
	G_OBJECT_CLASS (ft_aggregated_stats_entry_parent_class)->finalize (obj);
}

/**
     * Model for aggregated daily stats
     */
static GType
ft_aggregated_stats_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtAggregatedStatsEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_aggregated_stats_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtAggregatedStatsEntry), 0, (GInstanceInitFunc) ft_aggregated_stats_entry_instance_init, NULL };
	GType ft_aggregated_stats_entry_type_id;
	ft_aggregated_stats_entry_type_id = g_type_register_static (gom_resource_get_type (), "FtAggregatedStatsEntry", &g_define_type_info, 0);
	FtAggregatedStatsEntry_private_offset = g_type_add_instance_private (ft_aggregated_stats_entry_type_id, sizeof (FtAggregatedStatsEntryPrivate));
	return ft_aggregated_stats_entry_type_id;
}

GType
ft_aggregated_stats_entry_get_type (void)
{
	static volatile gsize ft_aggregated_stats_entry_type_id__once = 0;
	if (g_once_init_enter (&ft_aggregated_stats_entry_type_id__once)) {
		GType ft_aggregated_stats_entry_type_id;
		ft_aggregated_stats_entry_type_id = ft_aggregated_stats_entry_get_type_once ();
		g_once_init_leave (&ft_aggregated_stats_entry_type_id__once, ft_aggregated_stats_entry_type_id);
	}
	return ft_aggregated_stats_entry_type_id__once;
}

static void
_vala_ft_aggregated_stats_entry_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	FtAggregatedStatsEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_AGGREGATED_STATS_ENTRY, FtAggregatedStatsEntry);
	switch (property_id) {
		case FT_AGGREGATED_STATS_ENTRY_ID_PROPERTY:
		g_value_set_int64 (value, ft_aggregated_stats_entry_get_id (self));
		break;
		case FT_AGGREGATED_STATS_ENTRY_DATE_PROPERTY:
		g_value_set_string (value, ft_aggregated_stats_entry_get_date (self));
		break;
		case FT_AGGREGATED_STATS_ENTRY_CATEGORY_PROPERTY:
		g_value_set_string (value, ft_aggregated_stats_entry_get_category (self));
		break;
		case FT_AGGREGATED_STATS_ENTRY_DURATION_PROPERTY:
		g_value_set_int64 (value, ft_aggregated_stats_entry_get_duration (self));
		break;
		case FT_AGGREGATED_STATS_ENTRY_COUNT_PROPERTY:
		g_value_set_int64 (value, ft_aggregated_stats_entry_get_count (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_aggregated_stats_entry_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	FtAggregatedStatsEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_AGGREGATED_STATS_ENTRY, FtAggregatedStatsEntry);
	switch (property_id) {
		case FT_AGGREGATED_STATS_ENTRY_ID_PROPERTY:
		ft_aggregated_stats_entry_set_id (self, g_value_get_int64 (value));
		break;
		case FT_AGGREGATED_STATS_ENTRY_DATE_PROPERTY:
		ft_aggregated_stats_entry_set_date (self, g_value_get_string (value));
		break;
		case FT_AGGREGATED_STATS_ENTRY_CATEGORY_PROPERTY:
		ft_aggregated_stats_entry_set_category (self, g_value_get_string (value));
		break;
		case FT_AGGREGATED_STATS_ENTRY_DURATION_PROPERTY:
		ft_aggregated_stats_entry_set_duration (self, g_value_get_int64 (value));
		break;
		case FT_AGGREGATED_STATS_ENTRY_COUNT_PROPERTY:
		ft_aggregated_stats_entry_set_count (self, g_value_get_int64 (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

