proxy-classes

NHibernate Get objects without proxy

旧城冷巷雨未停 提交于 2019-12-18 03:40:31
问题 I am using NHibernate(2.0.1.4) with NHibernate.Linq(1.0.0.4) to get Objects of the type Node from the Database. When I get these objects, the last object of the collection I got is of the type Proxy (because I used "NHibernate.ByteCode.LinFu"" ) I used the following linq query: var mynodes = from node in session.Linq<Node>() where ancestorNodes.Contains(node.Id) select node).ToList() anchestorNodes is a list of Id's for the node objects to get. When I have 3 id's in the "ancestorNodes" list,

Fixing BeanNotOfRequiredTypeException on Spring proxy cast on a non-singleton bean?

六月ゝ 毕业季﹏ 提交于 2019-12-17 15:46:07
问题 I'm having an issue with pulling a Spring bean from an application context. When I try; InnerThread instance = (InnerThread) SpringContextFactory.getApplicationContext().getBean("innerThread", InnerThread.class); I get; org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'innerThread' must be of type [com.generic.InnerThread], but was actually of type [$Proxy26] Without the specified class in the getBean() call I get a ClassCastException (which you can see in detail

How do I serialize all properties of an NHibernate-mapped object?

时光总嘲笑我的痴心妄想 提交于 2019-12-17 13:58:47
问题 I have some web methods that return my objects back as serialized XML. It is only serializing the NHibernate-mapped properties of the object... anyone have some insight? It seems to be that the web methods are actually serializing the NHibernate proxies instead of my classes. I've tried using [XMLInclude] and [XMLElement], but the properties are still not serializing. I have a really horrible hackish way of getting around this, but I wondered if there was a better way! Something like this: <

How do I serialize all properties of an NHibernate-mapped object?

女生的网名这么多〃 提交于 2019-12-17 13:58:04
问题 I have some web methods that return my objects back as serialized XML. It is only serializing the NHibernate-mapped properties of the object... anyone have some insight? It seems to be that the web methods are actually serializing the NHibernate proxies instead of my classes. I've tried using [XMLInclude] and [XMLElement], but the properties are still not serializing. I have a really horrible hackish way of getting around this, but I wondered if there was a better way! Something like this: <

reflection.proxy not valid when override

谁说胖子不能爱 提交于 2019-12-13 08:25:30
问题 It seems reflection.proxy does not what is expected when there are overriden methods. In detail, starting with simple application: static void debug( String fmt, Object... args ) { System.out.println( String.format(fmt,args)); } interface I { void m1(); void m2(); } static class A implements I { public void m1() { System.out.println( "A.m1" ); m2(); } public void m2() { System.out.println( "A.m2" ); } } static class B extends A { @Override public void m2() { System.out.println( "B.m2" ); } }

Wcf Service Proxy Name / Namespace naming strategy

拜拜、爱过 提交于 2019-12-12 12:21:03
问题 Anyone have a naming strategy that works well for service proxy classes? For example, if I am given three web services within two projects as follows: XWs AService.asmx YWs BService.svc CService.svc What would use as the Service Reference Name & Namespace for AService , BService and CService ? In general, I'd like something in the proxy name/namespace to indicate that the thing being used is not a concrete class, but represents a proxy - both so it doesnt clash with usage of concrete classes

Specializing a QAbstractProxyModel for adding a column: the table cells becomes empty

老子叫甜甜 提交于 2019-12-12 02:43:27
问题 I have created a mixin-like proxy model (Qt5) which just adds an extra first column to another proxy model, for adding a QToolBar of actions to each row of the table view (for example, a "delete" button). The model just provides a way of populating a QList<QVariant> for the first column. The delegate must know what is the meaning of each QVariant (usually int s/ enum s identifying actions), and populate the QToolBar accordingly. As last feature, if there's no actions, no extra column is added

(AS7) Error calling remote EJB method with proxified CDI bean in parameter

心不动则不痛 提交于 2019-12-12 00:05:22
问题 Can I call a remote EJB method with CDI bean in parameter method? Like this: I have a LoggedUserProducer.java thats produces a User from the database. public class LoggedUserProducer { @Produces @SessionScoped @LoggedUser public User produceLoggedUser() throws Exception { ... //load user from database with a request token return user; } } And I have a JSF Bean thats make the EJB call: CarController.java @Named @ViewScoped public class CarController implements Serializable { @Inject //I have a

Wrapping a Vararg Method in ActionScript

雨燕双飞 提交于 2019-12-11 15:54:23
问题 I have a vararg method that I'd like to act as a proxy for another vararg method, but I'm not sure how to do it. Here's the basic code: class MyClass { public function a(...args:*):* { // other code b(args); // other code } public function b(...args:*):* { // do stuff with args } } I'm porting the code from Java, where the type system knows that the arguments are actually supposed to be Strings, not arrays, so it can figure out to invoke b() by directly passing the arguments, and everything

How to create a wrapper for a large interface

对着背影说爱祢 提交于 2019-12-11 14:15:24
问题 I want to create a wrapper that traps a particular exception and retries for all methods in a large (100+ methods) interface. I have the retry code working no worries, but I can't figure out how to hook up an implementation of the interface without cut'n'paste into all the methods. I tried to use a missing method handler but that meant that I couldn't have it implement the interface. Abstract is obviously out as I won't be able to instantiate it. I'm hoping for a better solution than creating