What grid are you using? I had the same problem with the telerik grid when
I first started using it. That grid wants a select all linq query like
repository.findall() or a where statement and the grid adds in the
skip()/take() if you set up paging. So what I found was that nhibernate
couldn't pa
I like Fluent NHibernate to configure NHibernate
here's the relavent using statements
using NHibernate;
using FluentNHibernate;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
***
I believe QueryOver is just a type safe layer on top of Criteria.
http://nhforge.org/blogs/nhibernate/archive/2009/12/17/queryover-in-nh-3-0.aspx
On Tue, Jan 25, 2011 at 10:12 AM, Daniel Lidström wrote:
> On 14 Jan, 01:27, Vikram Nayak wrote:
>> Are there any best practices / scenarios when on
well, there's a lot of things that can cause a lot of entities to be
loaded.
your mappings could be loading all of the child entities.
your queries could be bringing back way too much information.
So question would be:
What's the db schema look like?
what do your mappings look like?
how are you
You don't have to make any changes to migrate your database.
NHibernate should continue to work.
If you want to use SQL2008 specific functionality then you would need
to update the dialect to SqlServer2008.
On Wed, Feb 23, 2011 at 12:46 PM, sanjay kumar wrote:
> We are using nHibernate older ver
d compatability
> features.
> Thanks
>
> Sent from my iPhone
>
> On 24-Feb-2011, at 1:12 AM, Fran Knebels wrote:
>
>> You don't have to make any changes to migrate your database.
>> NHibernate should continue to work.
>>
>> If you want to use SQL2008 speci
I've haven't use sql server ce, but I have use nhibernate on a sql server
database. We were able to port the database to Oracle 11g for a client
without any changes in nhibernate.
It just worked.
On Mar 2, 2011 10:21 AM, "Vinod" wrote:
> Hi,
>
> I need to build two applications which has almost
Not sure about why you aren't getting any data, but all your repository
methods aren't using transactions. I would add that. I'd also change your
getbyid method to use session.get instead of the criteria api.
for your data problems I would fire up sql profiler you look at the emitted
sql.
Perso
To me the database seems to be wrong.
If a contact can only exist for a single customer, then there shouldnt be a
many to many, but a many to one.
So you'd have customer and contacts and a foreign back to customer from the
contacts table. Is there addition information oh are capturing in the
cus
Is your object's property defined as a nullable DateTime?
I've had no issues with nullable DaytIme in either sqlserver or Oracle
using nhibernate.
On Nov 10, 2011 10:23 AM, "Davec" wrote:
>
> Hey, hoping for some help here,
>
> When I do a save NH tries to save 01/01/0001 for values which where
When do you think they should get fired?
What does you application code look like?
To my knowledge listeners only get fired when flushing to he db. So have
you committed a transaction or called session flush? If you poid strategy
is guid, then these don't get fired at save because nhibernate doe
Taha,
It's returning an array of the (the rows of the query) of an array (the
columns from the query)
CreateSQLQuery will run any abitrary SQL statement and always return
Object[]. It does this because it knows nothing of the underlying
structure, it's just passing the query through to the under
I don't think you are using Component correctly in this case.
See this link here:
http://ayende.com/blog/3937/nhibernate-mapping-component
The classic case for component in when 2 domain types live in the same
table.
It looks like what you want is a ManyToOne mapping
On Mon, Apr 16, 2012 at 8:
I haven't upgraded from 2.x -> 3.x, but you don't have to re-write all your
old queries.
Add an extension method to the NHibernate session that just forwards on you
Session.Linq calls to Session.Query.
The linq provider is built in, so you won't need the Nhibernate.Linq
library anymore.
On Frida
Why map it at all? The point of the mapping is to map domain properties to
table columns. If this is just a convenience method for your domain layer,
you shouldn't have to map it all.
On Monday, April 23, 2012, s-stude wrote:
> Hi.
>
> I'm using Nhibernate 3.2.0.4000 and FluentNHibernate 1.3.
pic.Votes, no session or session
> was closed
>
> If I remove the virtual keyword from this readonly property I get an
> error like this
> --- The following types may not be used as proxies:
> Core.Entities.Topic: method get_VotedUpCount should be 'public/
> protected virtual
p my session alive?
> Why just not to load all referenced data as well?
>
> On Apr 23, 9:18 pm, Fran Knebels >
> wrote:
> > you can mark your collection mapping as not Lazy.
> >
> > Since you are returning proxies for the the collection, once you call
> your
>
You might want to look at AutoMapper for situations like this.
you could build your Blog with Comments entity out and project only the
Blog properties into the DTO and then with another line, use automapper to
write the collection.
you could also use the Futures ability to bundle up the blog and
Why not have nhibernate regenerate the schema for every unit test.
Now you've got total isolation because the entire schema is dropped after
every test.
On Jun 8, 2012 5:51 PM, "SirSirAaron" wrote:
> Thanks for the super quick reply Jason. I think you may be right regarding
> the time at which n
To Anne's point. I like add explicit Addxx and Removexxx functions for
accessing any of my child collections.
Something like
public virtual void AddStudent(Student student)
{
if (Students.Contains(student))
return;
student.Teacher = this;
I'm not sure why you are trying to do this in the mapping.
If you just want the last vehicle added why not just map the CurrentVehicle
property to something like this
VehicleModel {
get
{
return mVehicleModels[mVehicleModels.Count - 1];
}
Since you are populating this list already and you only n
right.
if you are populating the the list on load and ordering it ascending like
your map says. then the current one is always the last in the list.
if you add any new ones during your session, they are newer than the ones
in the list and the last one is still the current one.
maybe i'm not und
http://nhforge.org/blogs/nhibernate/archive/2008/10/04/the-best-way-to-solve-nhibernate-bugs-submit-good-unit-test.aspx
if you pull down the source, there's a contributor's guide.html that gives
you the steps.
On Friday, August 10, 2012, cidico wrote:
> How to report a bug?
> What is the guide?
You have to tell of that it is a clobtype.
On Aug 27, 2012 10:43 PM, "Phil Haselden" wrote:
> I asked a question on StackOverflow about this:
> http://stackoverflow.com/questions/12105929/how-to-map-a-varcharmax-column-in-nhibernate-hbm-xml-mapping-files
> .
>
> A suggestion was to do the followi
I'm not sure I understand.
All linq variables are already strongly typed. There is no need to declare
from Person person, because the compiler is taking the type from your
Session.Query. it knows you are querying a strongly typed list of
Persons so the type of person must be Person.
See http://
I first off, you are using the QueryOver API, not the linq provider.
We would need to see your mappings because the foreign key inner join would
be created in your mappings. There could be one-to-many, many-to-many,
many-to-one relationships between moveis and actors, you need to write that
in yo
So are you mapping to a single table in your db or are you mapping to 2
separate tables. The use of a discriminator says a single table so while
you abstract Customer class won't have a Property name Discriminator, you
still have to map a discriminator column on your map.
See this post on inherit
I thought that's exactly how the blog post I sent to you showed. let me
try and define the question.
1. you have a single table Company that holds 2 types of records Customers
and Vendors.
2. The discriminator value for Customer is "Customer" and Vendor is
"Vendor"
3. your domain objects are a
another good blog entry for loquacious mapping.
On Wednesday, March 13, 2013, Roger Kratz wrote:
> http://nhforge.org/doc/nh/en/index.html#inheritance-tableperconcrete
>
> ** **
>
> ** **
>
> *From:* nhusers@googlegroups.com 'nhusers@googlegroups.com');>
> [mailto:nhusers@googlegroups.com '
It looks like you are missing the ID generator in your Id mapping. you
need to tell it who or how the primary key is being generated.
you want something in your mapping like
Id(x => x.Id, map =>
{
map.Column("Id"); //this is unneccesary because you've got the same name
map.Generator(Generators.A
Not that I know of.
But check out this article on inheritance
http://notherdev.blogspot.com/2012/01/mapping-by-code-inheritance.html
I've found his articles on NHibernate loquacious mapping invaluable.
On Wednesday, May 8, 2013, Drognan wrote:
> Forgot to say that I'm using the BeforeMapClassH
Usually NHibnerate wraps the true exception with the HibernateException.
Check the innerr exception to get the underlying error.
Mapping by code documentation is a little thin, but I found this series of
posts which walks through most if not all aspects of mapping by code.
http://notherdev.blogs
When map to a view, I map it like a table with a couple of exception.
I mark the mapping as read only and I create the id as a combination of all
the columns if you need a unique row.
On Jun 3, 2013 8:43 AM, "Maciej Gaweł" wrote:
> Hi
> I've got following issue, generally in my application when
Future is also supported in the linq provider.
On Jun 12, 2013 1:28 PM, "Pete Appleton" wrote:
> This is fairly easy to resolve with the QueryOver API and a Future -
> sorry, I don't use the LINQ API. With QueryOver, you can do something like
> this:
>
> ** **
>
> var postFuture = session.Qu
I would split the mappings into 3 dll's. I have your common mapping with
All the common mappings. Then have a Sql Server mapping dll and an Oracle
mapping dll which inherit the Common mapping and implements the db
specific Id strategy.
On Thursday, June 20, 2013, Felipe Oriani wrote:
> Hi guys
Where are you making this call to someUser.Roles? Is it in a view of an
MVC application? You you are trying to access someUser.Roles in the view
then the session has already been closed and you are out of luck. Are you
using view models in your MVC applications. You could grab whatever you
need
oracle doesn't have a problem connecting to oracle with the x64 client.
but there are issues when the version of Oracle.DataAccess.dll gets out of
sync with the other Oracle files. until the managed provider for Oracle
arrived I kept all my oracle files in their own directory that would then
get
you should just need to change the dialect and the driver. Use
intellisense so see what's available to you. Dialects are in the namespace
NHibernate.Dialects and drivers are in NHibernate.Driver
On Wed, Oct 9, 2013 at 8:53 AM, Rodrigo Stan wrote:
> Hi, any have a example with other database?
I think you are missing some stuff regarding your DependencyScope. I use
Windsor, but here's my setup.
Global.asax
public class MvcApplication : System.Web.HttpApplication
{
public static String sessionkey = "current.session";
public static String transactionkey = "curren
that's because you haven't made a link from the child to the parent.
when adding records to child lists in nhibernate it is common to add both
add/remove functions that manage the lists. Here's an example using a
child collection of ContactInformation.
public virtual void AddContactInfor
not due to improper mappings. Thanks!
>
> Mike
>
>
> On Tue, Jan 21, 2014 at 12:01 PM, Fran Knebels wrote:
>
>> that's because you haven't made a link from the child to the parent.
>>
>> when adding records to child lists in nhibernate it is common to
you might want to try using MoreLinq. MoreLinq adds a DistinctBy extension
method.
I setup a little test.
using (ISession session = SessionFactory.OpenSession())
{
using (ITransaction tx = session.BeginTransaction())
{
v
don't want to
> add any more external dependencies to the project, since users will have to
> download those too. Thanks!
>
> Mike
>
>
> On Fri, Jan 24, 2014 at 12:44 PM, Fran Knebels wrote:
>
>> you might want to try using MoreLinq. MoreLinq adds a DistinctBy
not worth it
>> for just this one. I'd rather find a good native NH way to do this. After
>> all, I can just wrap this up into an extension method..
>>
>>
>> On Fri, Jan 24, 2014 at 1:04 PM, Fran Knebels wrote:
>>
>>> the dll for morelinq is 57
yes. that should work. I thought you were trying to bring back the entire
entity, which is why you would use DistinctBy.
On Sun, Jan 26, 2014 at 1:28 PM, Mike Christensen wrote:
> Ah, so .Query supports it but .QueryOver does not..
>
>
> On Sun, Jan 26, 2014 at 7:41 AM, Oskar Berggren
> wrote
Here's an NHibernateInitializer class I use with mapping by code,
It should take care of everything you need.
using NHibernate.Cfg;
using NHibernate.Cfg.MappingSchema;
using NHibernate.Dialect;
using NHibernate.Driver;
using NHibernate.Event;
using NHibernate.Extensions.Domain;
using NHibernate.E
If your not using interceptors or eventlisteners, you can safely delete
that code.
I'm using eventlisteners to set poor man audit fields on my entities on
insert and update.
The interceptor was used for concurrency checking on save.
On Jun 27, 2014 1:31 PM, "Michael Murphy" wrote:
> Thank you,
Could you use filters?
On Oct 6, 2014 8:04 AM, "Daniel Thaller" wrote:
> I am creating queries from raw sql like this: ()
>
> var query = "SELECT * from ORDERS o where o.Year in (:orderYear));";
>
> var session = sessionFactory.OpenSession();
> var result =session.CreateSQLQuery(query)
>
http://ayende.com/blog/3993/nhibernate-filters
On Oct 6, 2014 11:05 AM, "Daniel Thaller" wrote:
> can you give an example of what you mean, please?
>
> On Monday, October 6, 2014 2:17:29 PM UTC+2, fknebels wrote:
>>
>> Could you use filters?
>> On Oct 6, 2014 8:04 AM, "Daniel Thaller" wrote:
>>
See here:
http://notherdev.blogspot.com/2012/01/mapping-by-code-inheritance.html
You are going to want a Table per subclass with a union subclass.
On Thu, Oct 23, 2014 at 12:09 PM, Xaxa Urtiz
wrote:
> Hello everybody,
> I have a problem with nhibernate mapping:
> I have a class Order which cont
Not at all. The third options states:
The third option is to use table per subclass with unioned subclasses. This
time there is no separate table for base class, common columns are
specified in each table for subclass separately and subclass tables share
the same key generator. Mapping union subc
use a projection in your linq query
using an anonymous type
var list=_session.Query().Cacheable().Orderby(t=>t.Title).Select(x
=> new { x.Id, x.Title}) .ToList();
or some 2 property class you defined
var list=_session.Query().Cacheable().Orderby(t=>t.Title).Select(x
=> new SomeClass { Id = x.Id
Marking Parent abstract will prevent the creation of the table.
On Oct 14, 2015 9:34 AM, "Luka" wrote:
> Hi,
> I am trying to map this class structure:
>
> public abstract class Entity
> {
>
> public virtual Guid Id {get;set;}
>
> public virtual int Version {get;set;}
>
> }
>
> public class Paren
I originally reported this bug
https://nhibernate.jira.com/browse/NH-2167
it says it was fixed 2 months ago.
On Nov 10, 2015 10:57 AM, "Koen Dobbels" wrote:
> Dear,
>
> I'm currenty trying to get the following statement out of nhibernate using
> criterias:
> SELECT coalesce(this_.number, '')
I don't think this is supported. If you are writing a universal windows
app, you're targeting the PCL.
Here's a discussion from the forum.
https://groups.google.com/forum/#!topic/nhusers/Rz7EODshxKE
Nhibernate doesn't currently support it, and might not ever.
I would put your Nhiberate code be
It doesn't. NHibernate has its own internal one. Remove the configuration
from you NHibernate configuration.
On Jan 14, 2016 11:26 AM, "Andreas Bauer"
wrote:
> Hi Everyone!
>
>
> I am not sure if NHibernate 4 still uses Castle / LinFu for lazy loading.
>
> In class UnableToLoadProxyFactoryFacto
An assembly.
On Feb 12, 2016 1:29 PM, "John Daues" wrote:
> I've come across this in an hbm.xml file:
>
> table="MyTable">
>
> 1:
>
>
> I don't understand the second Dir3.Dir4. Is it specifying a namespace? a
> dll?
> I can't find documentation describing this.
>
> --
> You received this message
I'd say just google for it.
https://www.google.com/search?q=guid.comb+performance&oq=guid.comb+performance&aqs=chrome..69i57.4210j0j7&sourceid=chrome&es_sm=122&ie=UTF-8
there's enough information out there about why you'd want to use such a
strategy and the performance implications.
TL;DR; is co
Why can't you implement IPreUpdateEventListener?
On Mon, Mar 7, 2016 at 9:12 AM, Felix Berlakovich
wrote:
> I am using decorators to decorate my entities. For example, I have a
> security decorator that hides values of entity properties not visible to
> the calling user. The decorators are put i
General Availability
http://stackoverflow.com/questions/2107484/what-is-the-difference-between-ga-rc-and-m2-release
On Mon, Mar 21, 2016 at 1:02 PM, John Daues
wrote:
> Thanks for your response. That's what I was looking for.
>
> Quick question, what does GA means (as below)
>
> Build 3.4.0.GA
It should. if you take a look at the source code for the driver's you'll
notice that the later drivers just inherit from the old drivers and add any
new version specific features.
On Mon, Oct 10, 2016 at 8:41 AM, Jason Elrick
wrote:
> I have legacy project in visual studio 2008 that uses nHiber
The error is pretty self explanatory. Your missing the oraops10.dll.
In your project migration did you upgrade the version of NHibernate? If
you did, you could move to the Oracle managed driver which makes all of the
Oracle client issues dissappear.
Integration with the native oracle client was
Richardo is correct. I've used RAW(16) before for Guid's in Oracle.
Easy way to verify is to generate the schema from your mappings.
On Fri, Dec 23, 2016 at 11:19 AM, Felipe Oriani
wrote:
> Ricardo,
>
> We have success implementing an IUserType but we are not sure what is the
> best appoach. W
7 AM, Felipe Oriani
wrote:
> Fran, how have you mapped it?
>
> We are using fluent nhibernate and we try this:
>
> Id(x => x.Id).Column("ID").GeneratedBy.GuidComb();
>
> it is not working. In the Oracle it is generating a key like this: "
> D3CCAC3449579D4EB7F
ith
> GeneratedBy.GuidComb().
> We understand your point Fran, but the same problem here :(
>
>
> On Fri, Dec 23, 2016 at 2:37 PM, Fran Knebels wrote:
>
>> yes. that is a guid in Oracle.
>>
>> Here's a bunch of info about Guid formatting between Oracle
have you set the AutoQuote keywords parameter?
I use the mapping by code feature. Here's my db configuration
Configure.DataBaseIntegration(db =>
{
db.Dialect();
db.Driver();
db.KeywordsAutoImport = Hbm2DDLKeyWords.AutoQuote;
A long time ago I tried stateless session to do what your doing and ended
up punting and replacing it with bulk copy.
Oracle, at least the full odp.net, had OracleBulkCopy which I ended up
using instead of NHibernate. I don't know if the bulk copy classes exist
in the managed provider.
The bulk
I don't like a solution that leverages the underlying database like the
link you mentioned.
This is a much better approach as outlined I the nhibnerate cookbook.
https://books.google.com/books?id=r1MoDwAAQBAJ&pg=PA347&lpg=PA347&dq=iusertype,+encrypted&source=bl&ots=Pzp1uneBYE&sig=EB2lf8-mpmfqeho
Aren't those symbols Unicode? You would need to store them in an nvarchar
column.
Conversely , you could store the html value in the column which would be
ASCII
On Dec 7, 2017 11:09 AM, "Felipe Oriani" wrote:
Hi,
We have a database which we store the currencies of the world. We have a
column
Just a shot in the dark, but your error says OK, while your enum is Ok.
I don't see any code where you are ensuring that where the Enum.Parse is
setting the ignoreCase flag correctly.
On Mon, Oct 1, 2018, 12:16 PM Art One wrote:
> Hello,
>
> I'm actually upgrading an older Project with nHiber
70 matches
Mail list logo