Sure, I am open to anything at this point. Are you talking about a one
to one relationship with a hand rolled sql query? Could you point me
to something similar to what you are describing?
Thanks.
On Feb 16, 10:28 pm, Fabio Maulo fabioma...@gmail.com wrote:
2010/2/17 Fabio Maulo
Hello,
All the documentation I see regarding HQL left joins work this way:
from Eg.Cat as cat
left join cat.Kittens as kitten
What if the mapping between cat and kitten doesn't exist, but there is
a mapping between kitten and cat?
I'd like to run this query:
from Eg.Cat as cat
left join
Hello,
Does NHibernate support compilation of queries (HQL, Criteria, LINQ)?
I was looking for ways to speed up the generation of the actual SQL, I
assume it has to be done each time a query is List()ed, or is there a
query cache for HQL, Criteria and LINQ?
Thanks!
Ricardo Peres
--
You
Hi Sal,
This sounds like temporal objects pattern. Check out Envers. Unfortunately,
it's Hibernate only (java) and as far as I know, we don't have a working
equivalent in .NET.
Thanks,
Jason
On Wed, Feb 17, 2010 at 5:29 AM, Sal salbass...@hotmail.com wrote:
Sure, I am open to anything at this
Thanks Lothan!
NH examples code I think follow this pattern:
using( var session = sessionFactory.CreateSession() )
using( var tx = session.BeginTransaction() ) {
var entity = new { Name = John };
session.Save(entity)
session.Flush()
}
Behavior
Easy fix. When configuring your session factory, replace the default
auto flush event listeners with the classes below.
[Serializable]
public class FlushFixEventListener : DefaultFlushEventListener {
public override void OnFlush(FlushEvent @event) {
try {
HQL named queries are compiled at the beggining.
Gustavo.
On Wed, Feb 17, 2010 at 2:50 PM, Ricardo Peres rjpe...@gmail.com wrote:
Hello,
Does NHibernate support compilation of queries (HQL, Criteria, LINQ)?
I was looking for ways to speed up the generation of the actual SQL, I
assume it
I tend to treat an NH transaction as a DB transaction, but I'm not
100% sure about this. I know there are hooks in the NH transaction
that are connected to the 2nd level cache. i'm not sure what else is
connected to the NH transaction. As of 1.2 a transaction is required
for NH to persist
Hi, Gustavo!
I didn't mean named queries, but those created with CreateQuery(String
queryString).
On a side note, if named queries are compiled at the beginning, it
means that we cannot have multiple queries, for different DB engines,
because some of them will not compile, is that so?
Thanks,
I have a legacy database that I'm restricted from changing. I have 2
related tables that both have a foreign key to the same 3rd table. In
my application I'd rather not have this relationship repeated on both
classes. But when I don't map this relationship for both classes I get
problems as
The compilation is done per session factory so i don't see any problem.
I don't think NH saves the conversion to SQL for any other query. HQL is
easily done at the beginning during BuildSessionFactory().
Gustavo.
On Wed, Feb 17, 2010 at 4:26 PM, Ricardo Peres rjpe...@gmail.com wrote:
Hi,
Instead session.CreateQuery
you can write session.GetNamedQuery
a named query can be an HQL or a SQL or a H-SQL
All queries wrote in the mapping are checked and compiled at
BuildSessionFactory
Dynamic queries as Criteria and QueryOver are dynamically created an so
interpreted/translated each
This link might help out w/r/t Transactions and the Second Level Cache:
http://blogs.hibernatingrhinos.com/nhibernate/archive/2008/11/09/first-and-second-level-caching-in-nhibernate.aspx
On Wed, Feb 17, 2010 at 7:58 AM, Jason Meckley jasonmeck...@gmail.comwrote:
I tend to treat an NH
NHibernate doesn't care about visibility so you could use internl / private
/ protected properties or just use fields. All of which can be hidden from
external classes and the reference exsits to keep NH happy.
On Wed, Feb 17, 2010 at 8:33 AM, Alex McMahon fluxmu...@gmail.com wrote:
I have a
Have you an idea about from where NH can know/read to write in the FK ?
2010/2/17 Alex McMahon fluxmu...@gmail.com
I have a legacy database that I'm restricted from changing. I have 2
related tables that both have a foreign key to the same 3rd table. In
my application I'd rather not have this
Robert,
Thanks, yes this is one solution I've arrived at, I've got a protected
property that I map for NH that is just a getter.
ClassB:
ClassA A;
protected virtual long ClassCId{
get{
return A.ClassC.Id
}set{ }
}
I just thought I'd see if there was a better way someone could suggest
On Feb
Fabio,
Thanks for your reply... I don't quite understand what you mean... I
think you're saying how can NH know that it needs to put something in
the DB if you don't tell it to. I see what you're saying
(particularly as it's not just a default canned value that needs to go
in). I guess what I
i all,
i have a query where i need to filter the returned items using
SetFirstResult/SetMaxResult.
In this query i need to use the special property .class (in hql is
... where p.MyAbstractProperty.class = .
At the moment i didn't find a way to use the setFirst/MAx results with
hql or to get
I have the following three tables.
ModelMemo is a joiner table
Model
ModelId
Name
CreateUserId
CreateTimestamp
LastupdatedUserId
LastupdatedTimestamp
Memo
MemoId
Name
CreateUserId
CreateTimestamp
LastupdatedUserId
IQuery q = session.CreateQuery(hql);
q.SetMaxResults(10).SetFirstResult(10);
IIRC, NH 2.1 or newer should use the .class property in HQL.
On Wed, Feb 17, 2010 at 10:44 AM, kor korkl...@yahoo.it wrote:
i all,
i have a query where i need to filter the returned items using
Using version 2.1.0.4
Since the following code clears the projection before adding the
rowcount as a projection if the target query had Group By clauses
these will be lost and affect the count returned. The rowcount will
be much higher than expected:
public static ICriteria
Hi,
I have many entities/mappings with 1:n, n:1 and n:m. How can I get all
classes related to User entity for example and go deeper until the
whole relation graph is built. In other words I want to get the
relation graph of the mappings.
Thank you.
--
You received this message because you are
I'm afraid it's not possible.
But if you have the use case, why not create the mapping on Cat? It's easier
if you don't go against the tool :-)
Diego
On Wed, Feb 17, 2010 at 08:48, Dor Rotman shumbat...@gmail.com wrote:
Hello,
All the documentation I see regarding HQL left joins work this
I am using sqllite for test cases in a project that leverages
NHibernate. Everything is working great, except when I try to create a
ReadUncommitted transaction:
e.g.
Session.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted)
The error message is: isolationLevel (thats it)
The call
access=readonly
Diego
On Wed, Feb 17, 2010 at 12:50, Alex McMahon fluxmu...@gmail.com wrote:
Fabio,
Thanks for your reply... I don't quite understand what you mean... I
think you're saying how can NH know that it needs to put something in
the DB if you don't tell it to. I see what
http://fabiomaulo.blogspot.com/2009/05/nhibernate-210-hql-with-clause.html
http://fabiomaulo.blogspot.com/2009/05/nhibernate-210-hql-with-clause.htmlor,
leaving the class unchanged you can map the collection of Kittens with
access=none and then use it in HQL
2010/2/17 Dor Rotman
Custom sql-insert might work. However, it's probably better to create the
ModelMemo entity and project it in your model.
Example:
class Model
{
public IEnumerableMemo Memos
{
get{ return ModelMemos.Select(mm = mm.Model); }
}
public void Add(Memo memo)
{
ModelMemos.Add(new
access=readonly
2010/2/17 Alex McMahon fluxmu...@gmail.com
Fabio,
Thanks for your reply... I don't quite understand what you mean... I
think you're saying how can NH know that it needs to put something in
the DB if you don't tell it to. I see what you're saying
(particularly as it's not
I stumbled upon this bug while trying to use NHibernate.Linq
[Test]
public void SelectWithWrapping()
{
var list = (from user in session.LinqUser()
select new Wrapper(user, xxx)).ToList();
Assert.AreEqual(3, list.Count);
}
public class Wrapper
{
public Wrapper(User
Hi all,
I have two classes:
Parent(1) and (*)Child.
I've spotted a weird situation. When I fetch a Parent object (with a
Child collection) using UniqueResultParent and after that Update a
Parent (I didn't made any modifications on Parent nor any Child
objects) nhibernate inserts a new copy of
Hi,
I have a table with requests and a corresponding request class.
A request has a property called Type which is a C# enumeration.
Possible types are NONE=0, TRICKLEFEED=1, etc.
When the type is NONE the value 0 is stored in the database. For
TRICKLEFEED 1 is stored in the DB.
How can I setup
sorry, found the stupid solution :)
setmaxresult on the iquery object and not inside the hql.
--
You received this message because you are subscribed to the Google Groups
nhusers group.
To post to this group, send email to nhus...@googlegroups.com.
To unsubscribe from this group, send email to
Hi all,
Allow me to preface this by saying I don't do much Open Source
development so please excuse me if this is not the correct place for
this discussion, or if I am reinventing the wheel.
As many of you know, NHibernate provides a simple API for Creating,
Updating, and Dropping a schema that
if i understand correctly, you wanna fetch one or more user, and would like
everything to be fetched with it
you can set all the associations to lazy=false either ithrough the mappings
file or when you fetch the object (with FetchMode=join).
if you're records are big, i think its better to use
Have you looked at the source (SVN) to see how Entries is used?
BasicCollectionPersister and OneToManyPersister use Entries in their
DoUpdateRows methods. Maybe you need to look at your need from another
direction.
On Feb 5, 11:39 am, Michael diSibio michael.disi...@gmail.com wrote:
The
Hi Dave, for me it's very cool and needed. Just as you, I also make update
schemas in a NUnit test, that is what we have at moment. But now, your tool
introduces a good alternative.
I agree, a command line tool is necessary, and also, a GUI tool would be
nice.
Thanks for your time and work
which is the difference in .NET ?
2010/2/17 haarrrgh haarr...@googlemail.com
When I write classes and mappings that contain Integer values, what
data types should I use?
short, int and long?
Or System.Int16, System.Int32 and System.Int64 ?
Does it make any difference which of these
No difference really.
http://stackoverflow.com/questions/62503/c-int-or-int32-should-i-care
Craig
On Wed, Feb 17, 2010 at 11:41 PM, haarrrgh haarr...@googlemail.com wrote:
When I write classes and mappings that contain Integer values, what
data types should I use?
short, int and long?
Or
only a note..
To add a dll or to add multiple dll you can use the hibernate.cfg.xml only.
2010/2/17 newman.de newman...@gmail.com
Hi all,
Allow me to preface this by saying I don't do much Open Source
development so please excuse me if this is not the correct place for
this discussion, or
IUserType if you have time to implements it otherwise just keep 0 and 1
since MyEnum is different than MyEnum?
I would know who said that 0 = null.
2010/2/17 Peter4922 peter4...@googlemail.com
Hi,
I have a table with requests and a corresponding request class.
A request has a property
http://nhforge.org/doc/nh/en/index.html#manipulatingdata-graphs
If a transient child is dereferenced by a persistent parent, nothing
special happens (the application should explicitly delete the child if
necessary) unless cascade=all-delete-orphan, in which case the orphaned
child is deleted.
In
I am evaluating using NHibernate as the ORM for our platform. In our
environment, there are multiple servers performing operations on the
database. I'd like to be able to use sequential IDs when adding new
records to certain tables. I have read about and experimented with the
'guid.comb' ID
42 matches
Mail list logo