when using @transactional do i need to use jpatemplate/hibernatetemplate ?
when using @transactional do i need to use jpatemplate/hibernatetemplate ? ...
when using @transactional do i need to use jpatemplate/hibernatetemplate ? ...
I'm getting an NPE while trying to read in an image file, and I can't for the life of me figure out why. Here is my line: BufferedImage source = ImageIO.read(new File(imgPath)); imgPath is basically guaranteed to be valid and right before it gets here it copies the file from the server. When it hits that line, I get this stack trace...
Hello! I have trouble getting JPopupMenu's position. What I need is: to be able to right click on the work area, click some menu item, and it would create an element "in place", so right under the position of the previously displayed menu. I tried getting the position of the menu itself and of its items, but it gives me constant value...
Coming from Perl, I sure am missing the "here-document" means of creating a multi-line string in source code: $string = <<"EOF" # create a three line string text text text EOF In Java I have to have cumbersome quotes and plus signs on every line as I concatenate my multiline string from scratch. What are some better alternatives? D...
I'm using a static code block to initialize some controllers in a regsitry I have. My question is therefore, can I guarantee that this static code block will only absolutely be called once when the class is first loaded? I understand I cannot guarantee when this code block will be called, Im guessing its when the Classloader first loads ...
Hi Experts, I have a requirement where I have to select around 60 million plus records from database. Once I have all records in ResultSet then I have to formate some columns as per the client requirement(date format and number format) and then I have to write all records in a file(secondary memory). Currently I am selecting records o...
I'm creating the server side implementation of an AJAX based web application, where the client side receives responses that are domain objects serialized as JSON. In order to provide a common look and feel, I would like to create templates for different types of domain objects, and re-use these as Spring views for multiple controllers. ...
For my company, I'm making a batch script to go through and compile the latest revisions of code for our current project. I'm using Ant to build the class files, but encountered a strange error. One of the source files imports .* from a directory, where there are no files (only folders), and in fact, the folders needed are imported right...
Is there a way (e.g., via an event?) to determine when a Swing component becomes 'displayable' -- as per the Javadocs for Component.getGraphics? The reason I'm trying to do this is so that I can then call getGraphics(), and pass that to my 'rendering strategy' for the component. I've tried adding a ComponentListener, but componentShown...
Dear All, I want to mock a ResultSet. Seriously. I'm refactoring one big complicated piece of code which is parsing data from ResultSet, and I want my code to behave identically. So, I need to write a unit test for the piece being refactored to be able to test this. After googling I came up with 2 ideas: Use EasyMock, write looooong ...
Isn't there a way with Hibernate to return a list of (primitive) values from one column in a table? I need this for a subselect where I only want rows where a particular field is not in a list of ids from another table. ...
When you drag a block of text from a Word document into a Java text component, the text is removed from the Word document. This is obviously undesirable in some cases. Is there a way I can prevent Word from removing the text, while still copying it into the Java text component? ...
I'm trying to lookup an EJB from a standalone java application. I'm thinking in terms of WebSphere Application Server 6.1, but if someone knows how to do this for another application server, it may get me in the right direction. What I'm currently doing: initialContext= new InitialContext(env); initialContext.lookup(""); lc ...
Hi, I have a rather enormous project in which I'm trying to retrofit in-memory data. Essentially, I have a big collection of objects which contain primitives and other objects which exist in hibernate. Large sections of non-dao code rely on lazy-loading through hibernate to hydrate objects on the fly. However, since everything exists in ...
I have a Java project that needs a "addon" interface. I was thinking about loading some kind of class files having default methods like initialize() and shutdown() that will be called after the class has been loaded into the application. Is this the way to do it? How would I approach this problem? ...
I would like to listen for the mouse over event in GWT 1.6. Since GWT 1.6 has introduced handlers and deprecated listeners I'm unsure as to how I can accomplish this with what little information exists. Note: I have an Element object. That's what I need to add the mouse handler to. I apologize for my lack of clarity. Thanks! ...
I have the following many-to-many mapping: public class Student implements { @Id @GeneratedValue private Integer xID; @ManyToMany @JoinTable(name = "x_y", joinColumns = { @JoinColumn(name = "xID")}, inverseJoinColumns={@JoinColumn(name="yID")}) private Set<Cat> cats; } public class Cat implements { @Id ...
I have been tasked with refactoring some components that used xmlbeans to now make use of jaxb. Everything is going great, until I get to a place where the previous author has called the copy() function of one of the XmlObjects. Since all objects in xmlbeans extend XmlObject, we get the magic deep copy function for free. Jaxb does not s...
I need to encode/decode UTF-16 byte arrays to and from java.lang.String. The byte arrays are given to me with a Byte Order Marker (BOM), and I need to encoded byte arrays with a BOM. Also, because I'm dealing with a Microsoft client/server, I'd like to emit the encoding in little endian (along with the LE BOM) to avoid any misunderstand...
I'm looking for an alternative to the rrdtool It need to be fast, reliable, able to handle large amounts of data and have a Java interface. One possibilty I'm investigating is KDB+ Any other ideas? ...