These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Best Practice : Composite Keys
PostPosted: Fri Sep 29, 2006 10:50 am 
Newbie

Joined: Tue Sep 19, 2006 12:19 pm
Posts: 12
Location: Isle of Man
Hi,

I wonder if someone could please advise what is the established best practice for NHibernate to work with Composite keys.

My Mapping is:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<!-- NHibernate mapping file, generated 29/09/2006 12:13
    This file must be saved with a .hbm.xml extension and must be set to be compiled as an Embedded Resource. -->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
   <class name="Duke.DIMPLE2.NHibernate.OutletStockItem, Duke.DIMPLE2" table="STO_OutletStockItem">
      <composite-id name="CompositeKey" class="Duke.DIMPLE2.NHibernate.OutletStockItemCompositeKey, Duke.DIMPLE2">
         <key-property name="Outl_Code"/>
         <key-property name="SIte_Code"/>
      </composite-id>
      <property name="SGro_Code" column="SGro_Code" type="string" length="6" />
      <property name="SIte_Price" column="SIte_Price" type="System.Int32" />
      <property name="SIte_IsStocked" column="SIte_IsStocked" type="System.Boolean" />
      <property name="SIte_IsDiscount" column="SIte_IsDiscount" type="System.Boolean" />
      <property name="SIte_IsDropShip" column="SIte_IsDropShip" type="System.Boolean" />
      <property name="SIte_SupplierCode" column="SIte_SupplierCode" type="string" length="10" />
      <property name="SIte_MaxStockQty" column="SIte_MaxStockQty" type="System.Int32" />
      <property name="SIte_MinStockQty" column="SIte_MinStockQty" type="System.Int32" />
      <property name="SIte_VATCode" column="SIte_VATCode" type="string" length="1" />
      <property name="SIte_StandardCost" column="SIte_StandardCost" type="System.Int32" />
      <property name="SIte_AverageCost" column="SIte_AverageCost" type="System.Int32" />
      <property name="SIte_CostOfSale" column="SIte_CostOfSale" type="System.Int32" />
      <property name="SIte_TradeNetPrice" column="SIte_TradeNetPrice" type="System.Int32" />
   </class>
</hibernate-mapping>




My class is currently:

Code:


using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Text;
using Duke.Lib.NHibernate;
using NHibernate;
using Nullables;
using Nullables.NHibernate;
using Duke.Lib.Serialization;
using Duke.Lib.Serialization.Providers;

namespace Duke.DIMPLE2.NHibernate
{
   public class OutletStockItem : NHibernateBase    {
      private string _sGro_Code = "";
      private int _sIte_Price = 0;
      private bool _sIte_IsStocked = false;
      private bool _sIte_IsDiscount = false;
      private bool _sIte_IsDropShip = false;
      private string _sIte_SupplierCode = "";
      private int _sIte_MaxStockQty = 0;
      private int _sIte_MinStockQty = 0;
      private string _sIte_VATCode = "";
      private int _sIte_StandardCost = 0;
      private int _sIte_AverageCost = 0;
      private int _sIte_CostOfSale = 0;
      private int _sIte_TradeNetPrice = 0;
      private OutletStockItemCompositeKey _compositeKey=new OutletStockItemCompositeKey();

      #region ~ Properties ~

      public OutletStockItemCompositeKey CompositeKey
      {
         get { return _compositeKey; }
         set { _compositeKey=value; }
      }

      /// <summary>
      /// Gets/sets the SGro_Code property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public string SGro_Code
      {
         get { return _sGro_Code; }
         set { _sGro_Code = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_Price property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public int SIte_Price
      {
         get { return _sIte_Price; }
         set { _sIte_Price = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_IsStocked property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public bool SIte_IsStocked
      {
         get { return _sIte_IsStocked; }
         set { _sIte_IsStocked = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_IsDiscount property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public bool SIte_IsDiscount
      {
         get { return _sIte_IsDiscount; }
         set { _sIte_IsDiscount = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_IsDropShip property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public bool SIte_IsDropShip
      {
         get { return _sIte_IsDropShip; }
         set { _sIte_IsDropShip = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_SupplierCode property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public string SIte_SupplierCode
      {
         get { return _sIte_SupplierCode; }
         set { _sIte_SupplierCode = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_MaxStockQty property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public int SIte_MaxStockQty
      {
         get { return _sIte_MaxStockQty; }
         set { _sIte_MaxStockQty = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_MinStockQty property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public int SIte_MinStockQty
      {
         get { return _sIte_MinStockQty; }
         set { _sIte_MinStockQty = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_VATCode property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public string SIte_VATCode
      {
         get { return _sIte_VATCode; }
         set { _sIte_VATCode = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_StandardCost property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public int SIte_StandardCost
      {
         get { return _sIte_StandardCost; }
         set { _sIte_StandardCost = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_AverageCost property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public int SIte_AverageCost
      {
         get { return _sIte_AverageCost; }
         set { _sIte_AverageCost = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_CostOfSale property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public int SIte_CostOfSale
      {
         get { return _sIte_CostOfSale; }
         set { _sIte_CostOfSale = value; }
      }
      /// <summary>
      /// Gets/sets the SIte_TradeNetPrice property.
      /// </summary>
      /// <value>The value to set or that is returned.</value>
      public int SIte_TradeNetPrice
      {
         get { return _sIte_TradeNetPrice; }
         set { _sIte_TradeNetPrice = value; }
      }

      #endregion

      /// <summary>
      /// Initializes a new instance of the <see cref="T:OutletStockItem"/> class.
      /// </summary>
      public OutletStockItem()
      {
         Initialise(typeof(OutletStockItem));
      }

      /// <summary>
      /// Finds all <see cref="T:OutletStockItem" /> items.
      /// </summary>
      /// <returns>
      /// Returns an array of <see cref="T:OutletStockItem" /> items.
      /// </returns>
      public static OutletStockItem[] FindAll()
      {
         return (OutletStockItem[])FindAll(typeof(OutletStockItem));
      }

      /// <summary>
      /// Finds all <see cref="T:OutletStockItem" /> items according to the specified <c>outl_Code</c> value.
      /// </summary>
      /// <param name="outl_Code">The Outl_Code value to search for.</param>
      /// <returns>
      /// Returns an array of <see cref="T:OutletStockItem" /> items.
      /// </returns>
      public static OutletStockItem[] FindByOutl_Code(string outl_Code)
      {
         Initialise(typeof(OutletStockItem));

         ISession iSession=PrepareForTransaction(typeof(OutletStockItem));
         ICriteria iCriteria=iSession.CreateCriteria(typeof(OutletStockItem))
            .Add(
            global::NHibernate.Expression.Expression.Eq("Outl_Code", outl_Code));
         IList iList=iCriteria.List();
         iSession.Transaction.Commit();
         iSession.Close();
         Array array=Array.CreateInstance(typeof(OutletStockItem), iList.Count);
         return (OutletStockItem[])array;

      }
      /// <summary>
      /// Finds all <see cref="T:OutletStockItem" /> items according to the specified <c>sIte_Code</c> value.
      /// </summary>
      /// <param name="sIte_Code">The SIte_Code value to search for.</param>
      /// <returns>
      /// Returns an array of <see cref="T:OutletStockItem" /> items.
      /// </returns>
      public static OutletStockItem[] FindBySIte_Code(string sIte_Code)
      {
         Initialise(typeof(OutletStockItem));

         ISession iSession=PrepareForTransaction(typeof(OutletStockItem));
         ICriteria iCriteria=iSession.CreateCriteria(typeof(OutletStockItemCompositeKey))
            .Add(
            global::NHibernate.Expression.Expression.Eq("SIte_Code", sIte_Code));
         IList iList=iCriteria.List();
         iSession.Transaction.Commit();
         iSession.Close();
         Array array=Array.CreateInstance(typeof(OutletStockItem), iList.Count);
         return (OutletStockItem[])array;

      }


      /// <summary>
      /// Finds all <see cref="T:OutletStockItem" /> items according to the specified <c>sIte_Code</c> value.
      /// </summary>
      /// <param name="sIte_Code">The SIte_Code value to search for.</param>
      /// <returns>
      /// Returns an array of <see cref="T:OutletStockItem" /> items.
      /// </returns>
      public static OutletStockItem FindBySIte_CodeAndOutl_Code(string sIte_Code,string outl_Code)
      {
         Initialise(typeof(OutletStockItem));

         ISession iSession=PrepareForTransaction(typeof(OutletStockItem));
         ICriteria iCriteria=iSession.CreateCriteria(typeof(OutletStockItem))
            .Add(
               new global::NHibernate.Expression.AndExpression(
                  global::NHibernate.Expression.Expression.Eq("SIte_Code", sIte_Code),
                  global::NHibernate.Expression.Expression.Eq("Outl_Code",outl_Code)));
         IList iList=iCriteria.List();
         iSession.Transaction.Commit();
         iSession.Close();
         if (iList.Count==1)
         {
            return (OutletStockItem)iList[0];
         }
         else return null;

      }

      public OutletStockItem Save()
      {
         return (OutletStockItem)base.Save(typeof(OutletStockItem));
      }

   }

   [Serializable()]
   public class OutletStockItemCompositeKey : NHibernateBase    {
      private string _outl_Code=string.Empty;
      private string _sIte_Code=string.Empty;

      #region ~ Properties ~

      public string Outl_Code
      {
         get { return _outl_Code; }
         set { _outl_Code=value; }
      }

      public string SIte_Code
      {
         get { return _sIte_Code; }
         set { _sIte_Code=value; }
      }

      #endregion


      #region ~ from Object ~

      public override bool Equals(object obj)
      {
         OutletStockItemCompositeKey outletStockItemCompKey=obj as OutletStockItemCompositeKey;
         if (outletStockItemCompKey!=null)
         {
            return outletStockItemCompKey.Outl_Code==this.Outl_Code &&
               outletStockItemCompKey.SIte_Code==this.SIte_Code;
         }

         return false;
      }

      public override int GetHashCode()
      {
         return Outl_Code.GetHashCode()+SIte_Code.GetHashCode();
      }
      #endregion



   }
}





Compiles fine, but doesn't seem to be pulling anythign back for the FindBySIte_Code() method.

Using MSSql 2000 with NHibernate 1.0.1.

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 11:25 am 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
in HIA (the book in the title bar), they recommend to avoid composite-keys at all cost.

This, of course, is something that we sometimes cannot change. They recommend wrapping the 2 (or more) columns that make up the composite-key and make them 1 object.

In the book, the example is:

User class:

Code:
public class User
{
    public string UserId;
    public int Organization_Id;

    public string Name;
}


in this case, the PK was UserId+Organization_Id. It then becomes:

Code:
public class UserId
{
   public string UserId;
   public string Organization_Id;
}

public class User
{
   public UserId UserId;
   public string Name;
}


This makes it easier to map (especially everywhere it is foreign Keyed).

_________________
------------------------------
Ben Scheirman
http://www.flux88.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 11:33 am 
Newbie

Joined: Tue Sep 19, 2006 12:19 pm
Posts: 12
Location: Isle of Man
Thanks for your quick reply.

That is indeed what I have in my class, and it seems to compile.

However the query system I am using is not working, eg. to get all items by SIte_Code, in my code I have the method:

Code:
public static OutletStockItem[] FindBySIte_Code(string sIte_Code)
      {
         Initialise(typeof(OutletStockItem));

         ISession iSession=PrepareForTransaction(typeof(OutletStockItem));
         ICriteria iCriteria=iSession.CreateCriteria(typeof(OutletStockItemCompositeKey))
            .Add(
            global::NHibernate.Expression.Expression.Eq("SIte_Code", sIte_Code));
         IList iList=iCriteria.List();
         iSession.Transaction.Commit();
         iSession.Close();
         Array array=Array.CreateInstance(typeof(OutletStockItem), iList.Count);
         return (OutletStockItem[])array;

      }



Am I doing this wrong, or is this a limitation of composite keys or my chosen query method?

And you're right about composite keys, I hate them too, but I have "inherited" them.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 12:20 pm 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
Quote:
That is indeed what I have in my class, and it seems to compile.
* i should really start reading these in depth before opening my big mouth :) *

Quote:
global::NHibernate.Expression.Expression.Eq("SIte_Code", sIte_Code));


That looks fine to me. What does the generated SQL look like?

_________________
------------------------------
Ben Scheirman
http://www.flux88.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 12:22 pm 
Newbie

Joined: Tue Sep 19, 2006 12:19 pm
Posts: 12
Location: Isle of Man
I have no idea! How can I get at that?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 2:12 pm 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
:)

in the configuration you can specify:

hibernate.show_sql = true


then you can look at the logs to see it. i generally configure log4net to spit out sql statements to the debug window, and everything else to a text file or database

_________________
------------------------------
Ben Scheirman
http://www.flux88.com


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 30, 2006 1:15 pm 
Newbie

Joined: Sat Aug 19, 2006 1:28 am
Posts: 5
subdigital, how do you configure log4net to output sql statements to the debug window? I have everything output to the text file, and it's hard to look for just the sql statements among all the other entries. Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 30, 2006 5:08 pm 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
http://logging.apache.org/log4net/relea ... ceappender

I think that's what I have. I'm not at work right now so I cannot check the exact one.

Also I have TDD.NET running all of my tests... the SQL comes to the Test window in OUTPUT. I think this may be because TDD.NET registeres a TraceListener, but I'm not certain.

If you're stuck with text file, then checkout BareTail or another log viewer. These allow you to color certain lines based on text searches, regular expressions and such. easy to make DEBUG level output a light gray so it's not very visible. these also let you monitor the logs in realtime.

_________________
------------------------------
Ben Scheirman
http://www.flux88.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 4:53 am 
Newbie

Joined: Tue Sep 19, 2006 12:19 pm
Posts: 12
Location: Isle of Man
subdigital wrote:
:)

in the configuration you can specify:

hibernate.show_sql = true


then you can look at the logs to see it. i generally configure log4net to spit out sql statements to the debug window, and everything else to a text file or database


Hi, sorry for the delay, was a weekend.

I have set my Web.config up as (I thought) it should be:

[code]
<configuration>
<configSections>
<section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
<bufferSize value="100" />
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<connectionString value="data source=hislop;initial catalog=xxx;integrated security=false;persist security info=True;User ID=xxxx;Password=xxxxx" />
<commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)" />
<parameter>
<parameterName value="@log_date" />
<dbType value="DateTime" />
<layout type="log4net.Layout.RawTimeStampLayout" />
</parameter>
<parameter>
<parameterName value="@thread" />
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%thread" />
</layout>
</parameter>
<parameter>
<parameterName value="@log_level" />
<dbType value="String" />
<size value="50" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%level" />
</layout>
</parameter>
<parameter>
<parameterName value="@logger" />
<dbType value="String" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%logger" />
</layout>
</parameter>
<parameter>
<parameterName value="@message" />
<dbType value="String" />
<size value="4000" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message" />
</layout>
</parameter>
<parameter>
<parameterName value="@exception" />
<dbType value="String" />
<size value="2000" />
<layout type="log4net.Layout.ExceptionLayout" />
</parameter>
</appender>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>

</log4net>

<nhibernate>
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
<add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect"/>
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
<add key="hibernate.connection.connection_string" value="Server=HISLOP;initial catalog=xxx;uid=xxxx;password=xxxx"/>
<add key="hibernate.show_sql" value="true" />
</nhibernate>

And I receive no logging output to either console (Output window in VS.NET 2005?) or the database. WHat am I doing wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 8:50 am 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
you need to specify a root appender..

it's something like:

Code:
<root>
      <priority value="INFO" />
      <appender-ref ref="myDbAppender" />
</root>

_________________
------------------------------
Ben Scheirman
http://www.flux88.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 11:57 am 
Newbie

Joined: Tue Sep 19, 2006 12:19 pm
Posts: 12
Location: Isle of Man
Hi,

I think there must be a more fundamental thing going wrong here. I am getting absolutely nothing out of log4net.

Code:
         <log4net>
         <appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
            <bufferSize value="100" />
            <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            <connectionString value="data source=xxxx;initial catalog=xxx;integrated security=false;persist security info=True;User ID=xxx;Password=xxxx" />
            <commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)" />
            <parameter>
               <parameterName value="@log_date" />
               <dbType value="DateTime" />
               <layout type="log4net.Layout.RawTimeStampLayout" />
            </parameter>
            <parameter>
               <parameterName value="@thread" />
               <dbType value="String" />
               <size value="255" />
               <layout type="log4net.Layout.PatternLayout">
                  <conversionPattern value="%thread" />
               </layout>
            </parameter>
            <parameter>
               <parameterName value="@log_level" />
               <dbType value="String" />
               <size value="50" />
               <layout type="log4net.Layout.PatternLayout">
                  <conversionPattern value="%level" />
               </layout>
            </parameter>
            <parameter>
               <parameterName value="@logger" />
               <dbType value="String" />
               <size value="255" />
               <layout type="log4net.Layout.PatternLayout">
                  <conversionPattern value="%logger" />
               </layout>
            </parameter>
            <parameter>
               <parameterName value="@message" />
               <dbType value="String" />
               <size value="4000" />
               <layout type="log4net.Layout.PatternLayout">
                  <conversionPattern value="%message" />
               </layout>
            </parameter>
            <parameter>
               <parameterName value="@exception" />
               <dbType value="String" />
               <size value="2000" />
               <layout type="log4net.Layout.ExceptionLayout" />
            </parameter>
         </appender>
         <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
            <layout type="log4net.Layout.PatternLayout">
               <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
            </layout>
         </appender>
            
         <root>
            <priority value="INFO" />
            <appender-ref ref="ConsoleAppender" />
         </root>

         </log4net>



As you can see, I have added the root element, pointing to the COnsoleAPpender (and have also testedi t with the Ado appender) with no avail. I have compared the configuration with the configuration from one of log4net's sample apps and they more or less match up - barring logistical and organisational changes, of course.

If I can't get log4net working, is there no way I can trace through the Find() call and try and get some SQL?

On a related note, I really would like ot get log4net working, as my colleague has just started using NHibernate and a call to Load() has caused an UPDATE (and not by trigger) so if we could identify how this could have happened it would be very useful.

Thanks for your help on this so far. I wish I could return help, but i am a noob with all this!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 12:21 pm 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
log4net won't throw any exceptions (with GOOD reason), so if you have an error with configuration you won't know unless you monitor the output window.

Log4net will spit out exceptions there if anything is going wrong.

_________________
------------------------------
Ben Scheirman
http://www.flux88.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 02, 2006 12:24 pm 
Regular
Regular

Joined: Tue May 31, 2005 3:18 pm
Posts: 117
Location: Houston
Quote:
On a related note, I really would like ot get log4net working, as my colleague has just started using NHibernate and a call to Load() has caused an UPDATE (and not by trigger) so if we could identify how this could have happened it would be very useful.


log4net rocks, once you get it working. It can really help.

As far as your friend, he has probably mapped a collection improperly. If you have a bidirectional association, one end has to "own" the association. This is done by setting inverse=true on the owning end of the relationship.

_________________
------------------------------
Ben Scheirman
http://www.flux88.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 3:30 am 
Newbie

Joined: Tue Sep 19, 2006 12:19 pm
Posts: 12
Location: Isle of Man
HI there,

I am closely monitoring my Console window (ie. the Output pane in VS.NET 2005)and nothing is coming up from Log4net. I'm referencing it from ever project, I am using what I believe is correct configuration and still it does not work .... all the time taking me away from my original problem with composite keys!

My friend is using a simple mapping, I guess we should post that as a separate issue. But log4net would definitely help us identify the issue with it!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 4:19 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
You also have to call log4net.XmlConfigurator.Configure() in your application for logging to work.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.