using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Reflection;
using Harlinn.Oracle.DBTool.Example.Common;
using Harlinn.Oracle.DBTool.Example.Types;
namespace Harlinn.Oracle.DBTool.Example.Entities.Web
{
[DataObject]
public partial class TagDataObject : DataObjectBase
{
private static readonly log4net.ILog sfLog = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static void LogException(Exception exc, MethodBase method)
{
Logger.LogException(sfLog, exc, method);
}
[DataObjectMethod(DataObjectMethodType.Select,true)]
public static TagEntityList GetAll( )
{
try
{
EntityContext entityContext = Context;
TagEntityList result = null;
if( entityContext != null )
{
result = entityContext.GetAllTags( );
}
return result;
}
catch (Exception exc)
{
LogException(exc, MethodBase.GetCurrentMethod() );
throw;
}
}
[DataObjectMethod(DataObjectMethodType.Select,false)]
public static TagEntity GetTagById( long id )
{
try
{
EntityContext entityContext = Context;
TagEntity result = null;
if( entityContext != null )
{
result = entityContext.GetTagById(id);
}
return result;
}
catch (Exception exc)
{
LogException(exc, MethodBase.GetCurrentMethod());
throw;
}
}
[DataObjectMethod(DataObjectMethodType.Select,false)]
public static TagEntity GetTagByItemAndName( long item, string name )
{
try
{
EntityContext entityContext = Context;
TagEntity result = null;
if( entityContext != null )
{
result = entityContext.GetTagByItemAndName(item,name);
}
return result;
}
catch (Exception exc)
{
LogException(exc, MethodBase.GetCurrentMethod());
throw;
}
}
[DataObjectMethod(DataObjectMethodType.Select,false)]
public static TagEntityList GetTagByEnumeration( long? enumeration )
{
try
{
EntityContext entityContext = Context;
TagEntityList result = null;
if( entityContext != null )
{
result = entityContext.GetTagByEnumeration(enumeration);
}
return result;
}
catch (Exception exc)
{
LogException(exc, MethodBase.GetCurrentMethod());
throw;
}
}
[DataObjectMethod(DataObjectMethodType.Select,false)]
public static TagEntityList GetTagByType( long type )
{
try
{
EntityContext entityContext = Context;
TagEntityList result = null;
if( entityContext != null )
{
result = entityContext.GetTagByType(type);
}
return result;
}
catch (Exception exc)
{
LogException(exc, MethodBase.GetCurrentMethod());
throw;
}
}
[DataObjectMethod(DataObjectMethodType.Select,false)]
public static TagEntityList GetTagByItem( long item )
{
try
{
EntityContext entityContext = Context;
TagEntityList result = null;
if( entityContext != null )
{
result = entityContext.GetTagByItem(item);
}
return result;
}
catch (Exception exc)
{
LogException(exc, MethodBase.GetCurrentMethod());
throw;
}
}
}
}