I met a problem when try to map an one-to-one relationship in a single
table.
For example there're two entities (Product and ProductDetail):
public class Product
{
public virtual int ProductID { get; set; }
public virtual string Name { get; set; }
public virtual float Price { get;
Hi,
On a mapped entity I have a Dictionarystring, string that is mapped
successfully for data retrieval as follows:
map name=Properties table=EntityProperty
key column=EntityID/
index column=Title type=System.String/
element column=Value type=System.String/
/map
I met a problem when try to map an one-to-one relationship in a single table.
For example there're two entities (Product and ProductDetail):
public class Product
{
public virtual int ProductID { get; set; }
public virtual string Name { get; set; }
public virtual float Price { get;
I have a question about the way session.Save works.
I have a session, I open a transaction over this session, and then
commit the transaction.
There are two different things I am doing within session and
transaction:
1. Load an entity and add another entity to one of its collections.
This works
To use associations your table should contain a foreign key. In your
current table definition you should use component, and the mapping
like this:
class name=Product table=Product
id name=ProductID column=ProductID
generator class=hilo/
/id
property name=Name/
But component mapping cannot implement lazy load. Any ways to get both
single table one-to-one mapping and lazy load?
Jeffrey Zhao
Blog: http://www.cnblogs.com/JeffreyZhao/
Twitter: http://twitter.com/jeffz_cn
--
From: hival hi...@ukr.net
Sent:
Thanks for the responses. I have setup caching on the Person entity
yes, I think I was misunderstanding how the query cache works, I was
hoping to avoid a trip to the DB to retrieve the Ids.
I'll have a read about the cache implementation options as well if
HashtableCacheProvider is only for
Hi,
I recently came across the case where a mapping file was missing the
mapping for a property in my class. I have a couple of fairly basic
mapping tests already such as can_create_session_factory. I would
like to create a all_properties_in_mapped_classes_are_mapped test.
Is there anything in
SDS is not really a DB, at least not in the RDBMS sense. It's not
relational at all. Given that NHib is an ORM (which emphasis on the
Relational part) I'm not sure it makes sense.
OTOH I expect that NHib would work against SQL Azure (http://
www.microsoft.com/azure/data.mspx) without needing
lazy loading for components does not have any sense.
2009/8/10 Jeffrey Zhao je...@live.com
But component mapping cannot implement lazy load. Any ways to get both
single table one-to-one mapping and lazy load?
Jeffrey Zhao
Blog: http://www.cnblogs.com/JeffreyZhao/
Twitter:
metadata from conf before BuildSessionFactory
2009/8/10 chris bikk...@gmail.com
Hi,
I recently came across the case where a mapping file was missing the
mapping for a property in my class. I have a couple of fairly basic
mapping tests already such as can_create_session_factory. I would
Yes I want to load a collection property. So I use a IPropertyAccessor
implementation to load and persist custom collections. It worked like
a charm until now. I've fixed this bug by creating a new collection:
public override void Set(object target, object value)
{
var val = new
Hey folks,
due to security reasons we are forced to only store usernames and
passwords in an encrypted format (prefered encryption algorythm is
AES). Now I want to know, if NHibernate supports something like that.
Or do I have to implement it myself?
Thanks for your help.
Nice Greets from
Oh .. I forgot to tell you, that I mean the connectionstring in
hibernate.cfg.xml
Sorry for that.
On 10 Aug., 16:31, Maik macgyver...@googlemail.com wrote:
Hey folks,
due to security reasons we are forced to only store usernames and
passwords in an encrypted format (prefered encryption
http://code.google.com/p/unhaddins/source/browse/#svn/trunk/uNhAddIns/uNhAddIns/UserTypes
The connection string will have nothing to do with this
implementation.
On Aug 10, 10:32 am, Maik macgyver...@googlemail.com wrote:
Oh .. I forgot to tell you, that I mean the connectionstring in
Maybe you got me wrong. I want the connection string to be encrypted.
On 10 Aug., 16:37, allan.ritc...@gmail.com allan.ritc...@gmail.com
wrote:
http://code.google.com/p/unhaddins/source/browse/#svn/trunk/uNhAddIns...
The connection string will have nothing to do with this
implementation.
http://nhforge.org/wikis/howtonh/dynamically-change-user-info-in-connection-string.aspx
2009/8/10 Maik macgyver...@googlemail.com
Maybe you got me wrong. I want the connection string to be encrypted.
On 10 Aug., 16:37, allan.ritc...@gmail.com allan.ritc...@gmail.com
wrote:
You can always use in the configuraton connectionstring_name in the
web/app.config and then encrypt the file. Then you can read the connection
string and decrypt it programmatically.
On Mon, Aug 10, 2009 at 11:31 AM, Maik macgyver...@googlemail.com wrote:
Hey folks,
due to security reasons
Hi,
I am trying to come up with a criteria to restrict an aggregate root
based on a set of tagIds.
public class Foo
{
public virtual int Id { get;set; }
public virtual IListTag Tags { get;set; }
}
public class Tag
{
public virtual int Id { get;set; }
public virtual string
there are the facilities in ASP.NET that allow encryption of connection
strings from connectionString section.
On Mon, Aug 10, 2009 at 5:58 PM, Maik macgyver...@googlemail.com wrote:
thanks fabio,
this is what i have been looking for!
=)
On 10 Aug., 16:50, Fabio Maulo
For a moment I saw a mirage Jen talking about ASP.MVC... but was only a
mirage ;)
2009/8/10 Ken Egozi egoz...@gmail.com
there are the facilities in ASP.NET that allow encryption of connection
strings from connectionString section.
On Mon, Aug 10, 2009 at 5:58 PM, Maik
Moving to nhibernate 2.1 from 1.2 I noticed a performance problem
doing proxying and I ended up noticing that castle dynamic proxy uses
the .net Type builder and the type build seems to have a bug where its
gets prgressivly slower the more types created. We have 300 different
types in our domain
If you need to merge data from several tables into one entity the
join statement might be for you. For collections you might instead
want to look up using fetch mode join.
/Oskar
2009/7/22 Sachin sachingupta1...@gmail.com:
I need to know that if I have to get data from multiple database
Somebody pointed us to the same problem we the same solution in
uNhAddIns.Personally
I saw some difference, in production, in a stress-tests (usage of CPU) but
I'm not completely sure that the problem was only LinFu DynamicProxy.
The real problem of LinFu, IMO, is this:
I have Organization and Article And I want to have an relation in the
database but not int the Organization object and not in the article
object.
I thought to make a OrganizationAndArticleMapping that hade
Organization and Article as properties, but that would make an new
table which I don't
ha ha ha :)It's ASP.NET core thing.
anyway, the MS MVC stuff is actually a very good imitation of Monorail.
almost as good ... :)
On Mon, Aug 10, 2009 at 6:18 PM, Fabio Maulo fabioma...@gmail.com wrote:
For a moment I saw a mirage Jen talking about ASP.MVC... but was only a
mirage ;)
I'm afraid I will say the same soon for another FX.
2009/8/10 Ken Egozi egoz...@gmail.com
ha ha ha :)It's ASP.NET core thing.
anyway, the MS MVC stuff is actually a very good imitation of Monorail.
almost as good ... :)
On Mon, Aug 10, 2009 at 6:18 PM, Fabio Maulo fabioma...@gmail.com
http://weblogs.asp.net/scottgu/archive/2006/01/09/434893.aspx
Tuna Toksöz
Eternal sunshine of the open source mind.
http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike
On Mon, Aug 10, 2009 at 5:31 PM, Maik macgyver...@googlemail.com wrote:
Hey folks,
access=none
2009/8/10 Niclas Pehrsson pehrs...@gmail.com
I have Organization and Article And I want to have an relation in the
database but not int the Organization object and not in the article
object.
I thought to make a OrganizationAndArticleMapping that hade
Organization and Article
Join?
Tuna Toksöz
Eternal sunshine of the open source mind.
http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike
On Mon, Aug 10, 2009 at 7:01 PM, Niclas Pehrsson pehrs...@gmail.com wrote:
I have Organization and Article And I want to have an relation in
I have been building an advanced search mechanism, and have now run
into the requirement for dynamic OR statements and i do not know if
there are any solutions possible with NHibernate. I will not know how
many parameters will be searched for, so it has to be dynamic. Just so
you understand, I am
How soon depends, if it is the thing that I have in mind.
Tuna Toksöz
Eternal sunshine of the open source mind.
http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike
On Mon, Aug 10, 2009 at 7:39 PM, Fabio Maulo fabioma...@gmail.com wrote:
I'm afraid I will
Criteria with disjunctions?
Tuna Toksöz
Eternal sunshine of the open source mind.
http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike
On Mon, Aug 10, 2009 at 7:43 PM, lukefrice lukefr...@gmail.com wrote:
states, and they
I have two entities, List and ListItem. My List entity have a
parent property: public virtual List listParent {get;set;}. My
queries works when listParent is null, but when I set a parent for
example, Countries parent list, and the child list is States. When
I do a query on ListItem to pulls
Yes. Is there a way to do that?
On Aug 10, 11:46 am, Tuna Toksoz tehl...@gmail.com wrote:
Criteria with disjunctions?
Tuna Toksöz
Eternal sunshine of the open source mind.
http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike
On Mon, Aug 10, 2009 at 7:43
https://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/querycriteria.html
https://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/querycriteria.htmlLook
for or.
Tuna Toksöz
Eternal sunshine of the open source mind.
http://devlicio.us/blogs/tuna_toksoz
I've tried this with HBM mapping files and the result is the same HBM2DDL
only creates one column for the first generator it sees and ignores the
parameters after that. The generator is configured correctly however as it
is trying to get a value from the correct column.
I will probably just have
Note: you have inherited the behaviour of NHibernate.Id.TableGenerator that
mean you should know what the behaviour is.
If you want your own generator you should
implements IPersistentIdentifierGenerator and IConfigurable (if needed) with
all you need for your custom generator.
2009/8/10 Chris
Well I finished running our integration tests and with linfu the tests
took 900 seconds and with castle it took 1800 seconds so there is
definatly some nasty stuff going on with castle . It all seems to be
just with the typebuilder and proxying since creating and saving is
the same with both
Hey Scott,
Can you please report your test case to the Castle Development Team.
Thanks!
http://groups.google.com/group/castle-project-devel
Sincerely,
William Chang
On Aug 10, 1:44 pm, srf scott.fl...@cmgl.ca wrote:
Well I finished running our integration tests and with linfu the tests
took
2009/8/10 srf scott.fl...@cmgl.ca
This proxy plugin
architecture in nhibernate was quite the lifesaver.
You have seen the light.
--
Fabio Maulo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
nhusers group.
Hello,
I would like to know if there is an update of this plugin for Visual
Studio 2008:
http://sourceforge.net/projects/nhibernateaddin/
or any similar product for Visual Studio 2008.
Regards,
mathmax
--~--~-~--~~~---~--~~
You received this message because you
Hi,
I just upgraded to 2.1.0 and ProjectionCriteria is now no where to be
seen :( Does anyone have any examples of how I can do this relatively
common query?
Thanks,
On Aug 10, 3:58 pm, imm102 ianmmc...@gmail.com wrote:
Hi,
I am trying to come up with a criteria to restrict an aggregate
A circular reference was detected while serializing an object of type
JsonResult
External issue. You should manage the serialization of your entities NH does
not have nothing to do with it.
2009/8/10 William Chang diehardb...@gmail.com
I have two entities, List and ListItem. My List entity
That was what I was wondering. Is this part of the expected behavior of
TableGenerator? It seems to only be an issue with the DDL script
generation. Other than that the TableGenerator functions as I need it to.
I am guessing I need to change something in SqlCreateStrings() and
Hmmm I think I see an idea now, looking at how the Configuration is created
I see how the SqlCreateStrings are called.
What I need is to define a generator with a parameter for AllColumnNames and
then a seperate one for TableName and ColumnName and then use AllColumnNames
to generate the
Well i see that Or's can be applied, but I need them to be added
dynamically, so if they want to select 28 states, then it has 28 or's
added.
I am using a method which is passing in all the criteria i need and
then it returns them as an IQueryable and then it sends the whole
query into
this is programatic, you have as much flexibility as your imagination.
ICriterion x=something;
if(something)
x=Restrictions.Or(x,anotherRestriction);
if(another)
x=Restrictions.Or(x,anotherthinghere);
Can I tell what I mean?
Tuna Toksöz
Eternal sunshine of the open source mind.
What do you mean You should manage the serialization of your
entities? You mean to create a special class for compatibility with
JsonResult (ASP.NET MVC). Then, copy the properties from the populated
model class by NHibernate to the properties in the special class?
Another question, when
I don't believe there are any up-to-date visual tools for nHibernate mapping
right now. I think it would be cool to have one if it could generate clean
HBMs that could then be edited, but I still doubt I would use one anymore.
If you are working with an existing database you can use a code
Yes, this is very important for Castle project.
Tuna Toksöz
Eternal sunshine of the open source mind.
http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike
On Mon, Aug 10, 2009 at 8:47 PM, William Chang diehardb...@gmail.comwrote:
Hey Scott,
Can you please
There will be one soon for VS2010 if somebody want help a good point where
start is studying T4 (Text Template Transformation Toolkit):
http://msdn.microsoft.com/en-us/library/bb126445.aspx
The new integration is produced by Microsoft:
Hey,
This is actually not a Castle Dynamic Proxy issue per se. That's a
result of... BCL's unfortunate implementation of algorithm that looks
for name collisions in generated assembly. The algorithm is not linear,
so you see the performance decrease you described, as there are more and
more
Thanks Krzysztof.
2009/8/10 Krzysztof Koźmic krzysztof.koz...@gmail.com
Hey,
This is actually not a Castle Dynamic Proxy issue per se. That's a
result of... BCL's unfortunate implementation of algorithm that looks
for name collisions in generated assembly. The algorithm is not linear,
so
I agree with Fabio. The table needs to be selected anyway. It does not
make sense to only read half the columns from the table, and read the
rest in another query. Usually, the most expensive are db roundtrips
and joins.
I think hival's mapping is what you need.
You need to know what it means
That sounds awesome Fabio. Looking forward to seeing how that will work.
Will be great for getting started with existing data stores.
Chris
On Mon, Aug 10, 2009 at 12:02 PM, Fabio Maulo fabioma...@gmail.com wrote:
There will be one soon for VS2010 if somebody want help a good point where
I think I never ran accross the performance issue with linfu because
we redesigned it to no proxy our actual domain objects and created a
parallell set of objects that get proxied because even the best
interception times were still to slow for us and killed our simulator
since the simulator would
which is the question ?
2009/8/10 mhnyborg mhnyb...@gmail.com
I just want to here if NH 2.1 has some new features that makes
selection from 3 levels possible.
for example I want to load all customers with all orders and order
lines. I can get the Customers and orders using
The question is: can I distinct load this object graph: Baselines-
HasMany-BaselineMilestones-HasMany-BaselineMilestonePrevious
var baselines = session.CreateQuery( from Baseline b left join fetch
b.BaselineMilestones bm left join fetch bm.BaselineMilestonePrevious
)
Yes, looks great!
Do you think it will be available for VS 2010 beta 2 or the finale
release?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
nhusers group.
To post to this group, send email to
Create your own Disjunction object?
Disjunction disj = new Disjunction();
for(int i = 0; i numRestrictions; i++)
disj.Add( Restrictions.Eq( ) );
If not this, then please give an example of the sort of code you'd
like to write.
Cheers,
John
On Aug 10, 8:15 pm, lukefrice
If your question is how to do it, here you have an example:
*select o from Order o join fetch o.Lines li join fetch li.Article where
o.Id = :Id*
OR
*
s.CreateCriteria(typeof (Order))
.SetFetchMode(Lines, FetchMode.Join)
.SetFetchMode(Lines.Article,
but... you should understand the difference between set and bag ;)
P.S. bag es una bolsa de gatos.
2009/8/10 Dario Quintana conta...@darioquintana.com.ar
If your question is how to do it, here you have an example:
*select o from Order o join fetch o.Lines li join fetch li.Article where
o.Id
Thanks for reply.
But I have 3 collection
var baselines = session.CreateQuery( from Baseline b left join fetch
b.BaselineMilestones bm left join fetch bm.BaselineMilestonePrevious)
.SetResultTransformer
(Transformers.DistinctRootEntity)
Check out
http://ayende.com/Blog/archive/2006/10/28/QueryingCollectionsInNHibernate.aspx.
It demonstrates EXISTS sub-queries nicely, through HQL and through
criteria.
Cheers,
John
On Aug 6, 1:01 pm, Marvin Massih marvin.mas...@googlemail.com wrote:
On 6 Aug., 13:27, Jakob Tikjøb Andersen
So what I need is mapping an one-to-one relationship in a single table like I
demonstrated in the original mail.
How can I do?
Blog: http://www.cnblogs.com/JeffreyZhao/
Twitter: http://twitter.com/jeffz_cn
From: Fabio Maulo
Sent: Monday, August 10, 2009 9:32 PM
To: nhusers@googlegroups.com
So what I need is mapping an one-to-one relationship in a single table like I
demonstrated in the original mail.
How can I do?
Blog: http://www.cnblogs.com/JeffreyZhao/
Twitter: http://twitter.com/jeffz_cn
From: Fabio Maulo
Sent: Monday, August 10, 2009 9:32 PM
To: nhusers@googlegroups.com
67 matches
Mail list logo