java

Annotation a Map containig a non-entity class in JPA

Is it possible to use a map with a non-entity class in JPA? If yes, how should it be annotated correctly? @Entity class A { @HowShouldIAnnotateThis? private Map<B, Integer> myMap = new HashMap<B, Integer>(); } @Entity class B { ... } ...

How much support does GWT have for Java layout managers?

This seems to be a question where the answer is implicit, hence I can't find anything explicit. Does Google Web Toolkit only support custom layout managers, or a sub-set of the Java layout managers? For example, is it possible to take a Java Swing application using GroupLayout and get it to work with GWT? ...

How to use @BasicMap for a HashMap whose key values are entities

How should I use EclipseLink's @BasicMap annotation for a map whose key value is an entity and the value is an Integer? @Entity class A { // This doesn't work, as the key is an entity @BasicMap private Map<B, Integer> myMap = new HashMap<B, Integer>(); } @Entity class B { ... } ...

Declarative derived properties for mutable models in Java

Is there a framework for synchronizing properties of POJOs? For example, I want to express (in some high-level, declarative form) that foo.text = bar.text + baz.text or foo.y = (max(bars, y)).y without having to register property change, element add and remove listeners on values and (especially) collections, which are repetitive and err...

Setting JVM heap size at runtime

Is there a way to set heap size from a running Java program? ...

Emma Coverage metadata

Hi, I'm trying to understand Emma the code coverage tool and it seems ok till the moment I need the metadata, for example which line exactly is left out or is covered. I need this information for my own application but can't get to it. The xml report doesn't provide it. I would be thankful if anybody can help. ...

Validating instances of inner-classes

Hi, I have a Java class B with an inner class C. Some methods of B accept an instance of C as parameter but I only want to accept C instances created by the proper instance of B. Is there a way to do this validation at compile time? Example C c1 = new C(); B foo = c1.getB(); // foo was created by instance c1 C c2 = new C(); c2.method...

how to hide input text and enable selectonemenu when value of other seleconemenu is changed +jsf

Hello every thanks for supporting me for my last question Form getting submitted even A4j validation fails +jsf it is working i have selectonemenu for country list if the user is selecting country other than india he will directly enter state in textbox but if he selects india another selectonemenu appears. but on selecting value fro...

Java VMs that do not require an operating system?

I know that BEA was working on LiquidVM which didn't require an underlying operating system, but would like to know if anyone in the open source community is working on something similar. Ideally I would like to find an implementation where the VM is directly loaded by the OS boot loader. ...

In Java, how do I access the outer class when I'm not in the inner class?

If I have an instance of an inner class, how can I access the outer class from code that is not in the inner class? I know that within the inner class, I can use Outer.this to get the outer class, but I can't find any external way of getting this. For example: public class Outer { public static void foo(Inner inner) { //Question...

Is there an open source equivalent to FlexLM?

I am interested in studying license management patterns and coding techniques in detail. ...

How many threads can a Java VM support?

Does this vary by vendor? by operating system? other factors? ...

Creating an Array of JLabels

I'm trying to create 5 Jlabels using netbeans GUI Design, the Labels are supposed to display 5 different values. I need to combine these 5 JLabels in 1 array of Labels. is there any options in the design that let me do that? ...

Where is the "work" directory located for a Tomcat instance running in Eclipse?

In Eclipse you can configure numerous servers to run inside the IDE, including Tomcat. Depending on your Tomcat configuration, at some point in the life cycle of a webapp your JSP files will get compiled into servlets. These new servlet .class files are stored in the %TOMCAT_HOME%/work directory along with the .java intermediate file cre...

DataNucleus: How do I automatically perform actions when commiting a transaction?

Consider having an application using DataNucleus with the following persistence structure: You have a class that has two attributes like created (Date) and lastUpdate (Date): How do you automatically fill those attributes with the appropriate values when an object of this class is going to be committed? Appropriate values would be sett...

Uploading a Java Applet into a webpage

I have created a java letter game applet using netbeans 6.0 which also has a Microsoft Access Database for the High Scores. I want to upload it into a webpage (like how its done on miniclip facebook etc) I'd like to know how it could be done ...

Eclipse plugin to roll up if and for?

Hi all I'm at university, and we were taught to use notepad to programme java to start with. I moved onto notepad++ and quickly onto eclipse. In notepad++, i could roll up (plus minus sign) if statements or for loop as well as methods and classes. I wondered if there is a plugin for eclipse that allows me to do the same? Also, are there...

Java, Code Generation, and Persistence Frameworks

Are there any Java code generation persistence frameworks? Something that is "database first" rather than object model first? I know this is probably heresy in the Java world, I'd just like to know if any frameworks like this exist. I'm more of a .NET guy these days. So on the .NET-side tools like .NET Tiers or CSLA come to mind. ...

What's the right way to import Java source into Eclipse to avoid messing up references?

I created a java project and then tried to import Java source code from two different projects. I've been working on it for a few hours, deleting and re-creating the project dozens of times to try to reconcile all of the messed up references between these two projects - which other people say are supposed to work together reliably. What...

Why would one use Groovy over Java?

What benefits does Groovy offer over the use of Java other than more complicated syntax? ...