I do not apply lazy load because in any cases the inner work and in others
not work.
Do you never looked the querys that the NH generates?
2010/4/16 Markus Zywitza markus.zywi...@gmail.com
Did you try with a lazy loaded collection already?
-Markus
2010/4/15 Diego Dias diego.d...@gmail.com
Did you try with a lazy loaded collection already?
-Markus
2010/4/15 Diego Dias diego.d...@gmail.com
I did a test:
ICriteria c = session
.CreateCriteriaMatricula();
c.SetFirstResult(0)
.SetMaxResults(10);
I did a test:
ICriteria c = session
.CreateCriteriaMatricula();
c.SetFirstResult(0)
.SetMaxResults(10);
ICriteria c2 = CriteriaTransformer.Clone(c);
var count =
Good morning, guys.
I'm with a problem with the query that NHibernate generates. My mapping is
like bellow:
public class Matricula
{
[BelongsTo(IdTurma, NotNull=True)]
public Turma {get;set;}
}
public class Turma
{
[BelongsTo(IdCurso,
What is the query (in HQL or LINQ)?
-Markus
2010/4/13 Diego Dias diego.d...@gmail.com
Good morning, guys.
I'm with a problem with the query that NHibernate generates. My mapping is
like bellow:
public class Matricula
{
[BelongsTo(IdTurma, NotNull=True)]
I use ICriteria and is query I get in sql profile.
2010/4/13 Markus Zywitza markus.zywi...@gmail.com
What is the query (in HQL or LINQ)?
-Markus
2010/4/13 Diego Dias diego.d...@gmail.com
Good morning, guys.
I'm with a problem with the query that NHibernate generates. My mapping is
like
Can you share the ICriteria query code then?
-Markus
2010/4/13 Diego Dias diego.d...@gmail.com
I use ICriteria and is query I get in sql profile.
2010/4/13 Markus Zywitza markus.zywi...@gmail.com
What is the query (in HQL or LINQ)?
-Markus
2010/4/13 Diego Dias diego.d...@gmail.com
Please open an issue at Donjon, preferably with a patch.
-Markus
2009/10/13 Mike Christensen m...@kitchenpc.com
One quick question. Why do I need to do:
[Property(NotNull = true, ColumnType = Website.Price, Website)]
public Price VendorFees {get; set;}
Shouldn't it know the ColumnType
Hi guys - I've been struggling with this one for a while, the scenario
seems very basic but I've spent several hours on this and run into
what seems like NHibernate bugs..
Here's the situation. I have a class called Price which is
implemented like this:
[Serializable]
public class Price :
First, consider using System.Decimal instead of your own Price class.
If you still need some special feature and absolutely need your own
Price class, write a NHibernate IUserType. Here are some sample user
types: http://nhforge.org/wikis/howtonh/tags/IUserType/default.aspx
On Oct 12, 5:14 pm,
Thanks! Normally I'd just use Int32 or Decimal to store prices, but
my Price class has various functionality, formatting abilities, is
recognized by my Javascript layer, and all sorts of other things..
I will look into the IUserType thing, thanks!
Mike
On Mon, Oct 12, 2009 at 1:23 PM,
Hi - The URL you mentioned only seems to contain information about
persisting enums as strings, which is great since I was wondering
about that as well (as PostgreSQL users string for enums)..
Can you point me to any relevant information about IUserType and how
to create a user defined type that
Hi -
The IUserType approach almost works, however I need to mark my type as
[Serializable] which the implementation for IUserType does not allow
for.. You'll get a circular reference detected when serializing the
getters..
Guess it's back to the drawing board..
Mike
On Mon, Oct 12, 2009 at
That doesn't sound right... I've serialized IUserType before. Let me try to
find a sample...
On Mon, Oct 12, 2009 at 5:15 PM, Mike Christensen m...@kitchenpc.comwrote:
Hi -
The IUserType approach almost works, however I need to mark my type as
[Serializable] which the implementation for
Got it.. (BTW, I was referring to the JavascriptSerializer - perhaps
the XmlSerializer is smarter)..
You just have to mark the extra stuff with ScriptIgnore, such as this:
[ScriptIgnore]
public Type ReturnedType
{
get { return typeof(Price); }
}
Everything is working awesome now!!!
Thanks
One quick question. Why do I need to do:
[Property(NotNull = true, ColumnType = Website.Price, Website)]
public Price VendorFees {get; set;}
Shouldn't it know the ColumnType is Price, just as it would know the
column type for Int32 or Boolean? Having to specify the ColumnType in
the property
I think the [HasManyToAny] was exactly what I was looking for.
Thank you for the replies.
On Aug 11, 12:24 am, Markus Zywitza markus.zywi...@gmail.com wrote:
Hi Jake,
2009/8/10 JakeS jakesteven...@gmail.com
[ActiveRecord]
public class WhiteBoard : ModelBaseWhiteBoard, IRecentUpdated
I've got several classes defined like so:
public interface IRecentSpaceItem
{
[PrimaryKey]
int Id { get; set; }
DateTime LastUpdated{ get; }
}
[ActiveRecord]
public class WhiteBoard : ModelBaseWhiteBoard, IRecentUpdated
[ActiveRecord]
public class Discussion:
I think that you need to use the [HasManyToAny] attribute to map your
collection of IRecentUpdated objects to a list of possible types.
Take a look at
http://www.castleproject.org/activerecord/documentation/trunk/usersguide/relations/hasmanytoany.html
This is just off the cuff, but I believe
Hi Jake,
2009/8/10 JakeS jakesteven...@gmail.com
[ActiveRecord]
public class WhiteBoard : ModelBaseWhiteBoard, IRecentUpdated
[ActiveRecord]
public class Discussion: ModelBaseDiscussion, IRecentUpdated
You can get around it completely, if you use generic interfaces:
public interface
Thanks for your reply.
The initialization of the IList was not the issue, I actually
initialized it upon population therefor it didn't issue an exception for
it (I have however rewritten it now).
The fact remains though, and I seem to have nailed down what causes it.
If I add Index to the
Please open an issue at donjon, I'll add a guard clause in the
AR-initialization.
-Markus
2009/7/16 Jimmy Shimizu jimmy.shim...@gmail.com
Thanks for your reply.
The initialization of the IList was not the issue, I actually initialized
it upon population therefor it didn't issue an exception
http://support.castleproject.org/projects/AR/issues/view/AR-ISSUE-266
Markus Zywitza wrote:
Please open an issue at donjon, I'll add a guard clause in the
AR-initialization.
-Markus
2009/7/16 Jimmy Shimizu jimmy.shim...@gmail.com
mailto:jimmy.shim...@gmail.com
Thanks for your
Hi, I came across an issue when mapping an HasMany-collection.
with the following code:
private IListCartDiscount applicableDiscounts;
[HasMany(
typeof( CartDiscount ),
Access = PropertyAccess.FieldCamelcase,
Cascade =
If you put the HasMany on the IEnumerable, NH tries to add things to the
IEnumerable. I think the error is an NH bug, because the value is not tested
against null before checking the character. Nonetheless, your approach won't
function.
Use instead a protected or private IList for mapping and
25 matches
Mail list logo