All Questions
340
questions
2
votes
0
answers
59
views
How to convert this SQL query to NHibernate IQueryable query?
I have to create a query similar to the one below to paginate a parent-child query:
SELECT v.ProductId, MAX(v.Price) AS Price
FROM Variant v
GROUP BY v.ProductId
ORDER BY Price ASC;
I am using C# ...
0
votes
1
answer
173
views
nHIbernate query with conditional join
I'm trying to get an nHibernate query to work without success. Here is my data structure:
public class Permission {
public Guid Id {get; set;}
public string Name {get; set;}
}
public class ...
0
votes
2
answers
185
views
How to implement a Guid generator with insertBuilder on Nhibernate
I'd like to do a bulk insert with nhibernate using the insertBuilder.
But I want each row to have a unique Guid.
var mailIds = batch.Select(x => x.Id);
var guidGen = new GuidGenerator();
Dao....
1
vote
1
answer
43
views
NHibernate subquery to check atribute of referenced object
I need to filter a page of my Concept model, Concept references TelecoCompany, so I want to filter by the name of that TelecoCompany. I was having some errors while comparing, so I realized I need to ...
0
votes
1
answer
261
views
Make custom Restriction NHibernate for QueryOver
I'm stuck in a simple problem, I'd like to add a new custom restriction in NHibernate. I want to write a simple QueryOver with a fulltext index, an example with a Projections is here How to use Full ...
0
votes
1
answer
43
views
How to add "or" statement in ISession.QueryOver?
I have a question:
Is there a way to add "or" statement in ISession.QueryOver ?
Consider I have these values:
val1 = 0;
val2=0;
and my query:
.Where(Restrictions.Eq(Projections.Property()=&...
1
vote
2
answers
148
views
Does whitespace matter in sql queries using NHibernate?
Take a fairly typical SQL insert query with parameters in a C# project using NHibernate; it might be written like this:
Session
.CreateSQLQuery(
@"INSERT INTO my_table(COL_A, COL_B, .....
0
votes
1
answer
67
views
Nhibernate many to many with property
Hey i need help with a many to many relation in NHibernate i am getting this error :
NHibernate.MappingException: Unable to build the insert statement for class SelfHost.Core.Repository.implementation....
0
votes
1
answer
108
views
Nhibernate many to many xml
I want to make a many to many relation in Nhibernate, but I am stuck at the moment, I have 3 sql tables, student class and studentclassrelation and I have written 2 classes in c#
class Student
{
...
0
votes
1
answer
382
views
Troubleshooting SQL Timeout Expired
My C# application is currently throwing lots of the below exceptions:
Timeout expired. The timeout period elapsed prior to completion of
the operation or the server is not responding. This failure ...
0
votes
1
answer
41
views
nHibernate QueryOver: Filter length of main element and the length of sub elements
I have two entities: Pakage and Pole. The Pakage contains multiple Poles which are liked in pakage as reverse set.
I have a GUI which shows all Pakages if no restrictions are set on the GUI. One of ...
0
votes
1
answer
138
views
NHibernate execute the same query several times
I have stucked in executing NHibernate query several times with changing only one parameter.
Here is my code
if (channelCount > 1)
{
for (int i = 0; i < ...
0
votes
1
answer
261
views
NHibernate transform sql query to NHibernate QueryOver query
So I have a bit of a SQL query which I am not sure how to convert to NHibernate syntax
cast(case when count(distinct order) > 1 then count(distinct order) * -1 else max(order.orderId) end as int)
...
0
votes
1
answer
740
views
Query Source could not be identified
I am trying to generate a list of type Transaction from a list of type Posting by using group by:
var transactions = postings
.GroupBy(p => p.TransactionId, (key, g) => new { TransactionId = ...
-1
votes
1
answer
340
views
NHibernate query: string contained in either parent or child property
I'm tearing my hair out on this one...
Suppose we have a list of blogs which have tags assigned to them. The user searches for any term, and the result must include:
All blogs whose name contains ...