When I try to delete an entity which has a lazily loaded component
the
ISession.Delete method throws the following exception: Unable to cast
object of type 'System.Object' to type 'Namespace.ComponentClass'. If
I initialize the component before deleting the entity then the
ISession.Delete method su
When I try to delete an entity which has a eazily loaded component the
ISession.Delete method throws the following exception: Unable to cast
object of type 'System.Object' to type 'Namespace.ComponentClass'. If
I initialize the component before deleting the entity then the
ISession.Delete method su
Does Linq provider in NH 3.x support eager loading lazy components? I
know about "fetch all properties" option in HQL but I'd like to use
Linq. Thanks.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to nhusers@googl
Try this
Bag( x => x.AssemblyBlockList, map =>
{
map.Table( "PNP_AssemblyBlock" );
map.Key( k => k.Column( "IdProject" ) );
map.Cascade( Cascade.None );
map.Lazy( CollectionLazy.NoLazy );
map.Inverse( true );
},
rm => rm.OneToMany());
--
You received this message because you
I like the idea of the optional joined component or property. It
allows me to factor optional properties out from the main table to a
dedicated table thus allowing me to eliminate nullable columns in the
main table. Unfortunately I noticed that though I mapped joined
properties as optional (with
Correction:
constrained="true" should be omitted in your case, that is
I was just looking at SQL generated by NH with this option enabled and
disabled and forgot to remove it before pasting code to the answer.
--
You received this message because you are subscribed to the Google Groups
"nhuser
Looking at your DB schema it seems that you want to map one-to-one
association with a shared PK.
I can suggest the following solution which conform to your DB schema:
Osoba
I noticed that NH3.x doesn't take into consideration value of show_sql
setting for some SQL statements. When show_sql setting enabled NH3.x
doesn't log INSERT, UPDATE, DELETE statements to the console. This bug
was noticed on MsSql2008Dialect. I agree that this is a minor issue
but it's sometime in
could you elaborate on the idea of using proxy a little more
On Mar 7, 8:52 am, Fabio Maulo wrote:
> I'm seeing a proxy not a usertype
>
> 2010/3/7 hival
>
>
>
>
>
> > Yes.
> > The user type I'm currently developing is bound to a string co
nd query DB for additional data.
Then I need to assemble the data retrieved from DB and return as a
class.
On Mar 7, 3:02 pm, Fabio Maulo wrote:
> query DB inside an implementation of IUserType ?
>
> 2010/3/7 hival
>
>
>
>
>
> > In my current implementation of NH user type
In my current implementation of NH user type I need to query a DB for
some additional data. What is the safe/correct way to obtain a session
in this case? Can I use a current/ambient session or I should open a
new session based on the DB connection of the current session? Thank
you in advance.
--
I'm not sure whether it is the optimal solution but it works
the following somewhat abbreviated mapping work
btw the strategy you described is called "Table per class hierarchy"
maybe this example will help
[Serializable]
public class ClassId
{
public ClassId()
{
}
public virtual string StringId { get; set; }
public override bool Equals(object obj)
{
...
}
public override int GetHashCode()
{
...
}
}
--~--~-~--~~~--
cascade="save-update" on both bags will help
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email t
When initializing a collection NH doesn't consider the case that the
foreign key of the collection can be joined from another table.
NH assumes that the FK belongs to the table to which entity from the
collection has been mapped.
here is my test DB schema
create table A
(
a_id int not null ident
.koah.net/browse/NH-1747
>
> If this bug is a problem for you, it can't hurt to vote for/comment on
> the bug there...
>
>
>
> On Sun, Aug 16, 2009 at 8:24 AM, hival wrote:
>
> > I have a simple hierarchy of cla
I have a simple hierarchy of classes mapped with the "subclass + join"
strategy:
and another entity is supposed
Hmm...
Here is my mapping and SQL (NH2.1.0)
Parent
Try to specify constrained="true" in the User's side of the association.I'm not sure whether it is correct but it works. It
seems that NH doesn't look at the other side of the one-to-one assoc.
to find out whether the assoc. is optional or not.
--~--~-~--~~~---~--~--
To use associations your table should contain a foreign key. In your
current table definition you should use component, and the mapping
like this:
Remove ProductID property from ProductDeta
I'm not sure whether I clearly understand your question, but a
composite foreign key is mapped like this
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to nhu
as far as I know unidirectional assotiations are only possible when a
foreign key of an association allows null values
...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to
I see that it's corrected in NH2.1.0GA. Thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send e
In my opinion the "select" query of the TableGenerator class should
also contain "where" clause like the "update" statement of this class
do. The "select" query always fetches the first row of the
"next_hi_value" table and in the case when we have several rows in the
"next_hi_value" table "update"
25 matches
Mail list logo