-->
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.  [ 26 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Sat Jun 07, 2008 7:57 am 
Regular
Regular

Joined: Wed Oct 25, 2006 10:51 pm
Posts: 71
It's mentioned as an aside somwhere, but is the fact that NHibernate.Mapping.Attributes has worth adding to the list of "have to know to convert to nHibernate 2"?


Last edited by PandaWood on Sat Jul 12, 2008 10:16 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 24, 2008 10:49 am 
Expert
Expert

Joined: Fri Oct 28, 2005 5:38 pm
Posts: 390
Location: Cedarburg, WI
Yeah, we're wondering the same thing ... we can't upgrade to 2.0 until we figure out where Nullables and Nullables.NHibernate went ...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 25, 2008 5:48 am 
Beginner
Beginner

Joined: Tue May 02, 2006 8:04 am
Posts: 34
Is there a document somewhere which says were some functinality has moved or what you need to do now to get the same result. I'm talking about. In particular IEntityPersister, IJoinable, IType, IAssociationType,...


Top
 Profile  
 
 Post subject: Support <any> with meta-type="class"
PostPosted: Wed Jul 23, 2008 11:32 am 
Contributor
Contributor

Joined: Tue May 30, 2006 1:25 am
Posts: 29
See
http://jira.nhibernate.org/browse/NH-1403

The breaking change are:

- default meta-type is "string" (no more "class")

- when meta-type="class" the persistent type is a string containing the entity-name (persistentClass.FullName).

- to set a parameter in a query you must use
SetParameter("paraName", typeof(YourClass).FullName, NHibernateUtil.ClassMetaType)

H3.2 don't support meta-type="class" so, now, it is a specific NH feature.
http://www.hibernate.org/hib_docs/v3/re ... anymapping

_________________
Fabio Maulo.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2008 3:10 pm 
Contributor
Contributor

Joined: Tue May 30, 2006 1:25 am
Posts: 29
See
http://jira.nhibernate.org/browse/NH-1412

IPropertyAccessor have a new method:
CanAccessTroughReflectionOptimizer

_________________
Fabio Maulo.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 26, 2008 11:23 pm 
Newbie

Joined: Fri Aug 15, 2008 5:08 am
Posts: 6
Nels_P_Olsen wrote:
Yeah, we're wondering the same thing ... we can't upgrade to 2.0 until we figure out where Nullables and Nullables.NHibernate went ...


I never use Nullables and Nullables.NHibernate


public DateTime? CreateTime{
get;
set;
}


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 20, 2009 10:02 am 
Newbie

Joined: Tue Jan 20, 2009 9:54 am
Posts: 2
We ran into a unit test problem today that we suspect might be caused by a change in NHibernate.

Our setup has a class X and class Y. X has a set of Y (inverse = true, cascade = all-delete-orphan), and Y has a many-to-one to X (not-null = true).

In our business logic, there is a method to remove a Y from an X. It calls

x.y_set.Remove(y)

and also

y.X = null

This used to work, but not anymore. We removed the y.X = null and it works again.

Obviously, we understand that when we say not-null = true, we shouldn't set the value to null. However, it seems that the not-null verification has been moved and is now executed prior to all-delete-orphan cascade, whereas it was previously executed after cascading.

Does that make sense?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2009 10:10 am 
Newbie

Joined: Tue May 08, 2007 5:25 am
Posts: 3
Code:
Code:
public interface ICacheKeyProvider
{
   string IdForCache { get; }
}

Code:
public class User: ICacheKeyProvider
{
   public virtual Guid Id { get { return id; } }

   public string IdForCache { get { return BuildIdForCache(Id); } }
   public static string BuildIdForCache(Guid userId) { return userId.ToString(); }
}


Mapping:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
   <class name="SomeNamespace.User, SomeNamespace" table="[User]">
      <id name="Id" type="Guid" access="field.camelcase" column="id">
         <generator class="guid" />
      </id>
   </class>
</hibernate-mapping>


Exception:
Code:
NHibernate.InvalidProxyTypeException: The following types may not be used as proxies:
SomeNamespace.User: method get_IdForCache should be virtual

But IdForCache isn't part of the mapping, so why should it be virtual?
And it worked as expected in 1.2.0.

Also, about new methods in IInterceptor.
Code:
public object Instantiate(string entityName, EntityMode entityMode, object id)

What should I do if I don't want to implement any custom instantiation process?

PS: where we can get documentation that reflects current codebase? Documentation wasn't the strongest side of the NHibernate for a long time now, but c'mon! no documentation at all? This is ridiculous!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 21, 2009 5:21 am 
Newbie

Joined: Tue May 08, 2007 5:25 am
Posts: 3
Ahh, nevermind me. I was sick and delusional.

Except for the part about where to get the latest documentation.


Top
 Profile  
 
 Post subject: Collection Persister Constructor Changed
PostPosted: Tue Apr 14, 2009 7:52 am 
Newbie

Joined: Thu Jun 22, 2006 12:51 pm
Posts: 10
BasicCollectionPersister now require Configuration.
BUT if i provide custom CollectionProvider - his constructor accept only 3 params and no one Configuration there.

and creating collection persiter fails


Top
 Profile  
 
 Post subject: Re: NHibernate 1.2 to 2.0 Breaking Changes
PostPosted: Sat Feb 27, 2010 8:11 am 
Newbie

Joined: Tue Jun 26, 2007 4:53 am
Posts: 4
I have upgraded from NHibernate 1.0.2 to 2.1.2 recently and I have wrote about my experience in my blog. May be my experience be useful for someone else:

http://afsharm.blogspot.com/2010/02/upg ... o-212.html


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

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.