Configure JPA to let PostgreSQL generate the primary key value

Given the table definition: CREATE TABLE webuser( idwebuser SERIAL PRIMARY KEY, … ) Use the mapping: @Entity @Table(name=”webuser”) class Webuser { @Id @SequenceGenerator(name=”webuser_idwebuser_seq”, sequenceName=”webuser_idwebuser_seq”, allocationSize=1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator=”webuser_idwebuser_seq”) @Column(name = “idwebuser”, updatable=false) private Integer id; // …. } The naming tablename_columname_seq is the PostgreSQL default sequence naming for SERIAL and I recommend that you … Read more

How to assign more memory to Netbeans?

In the etc directory under your Netbeans-Home, edit the file netbeans.conf file. -Xms and -Xmx should be increased to the values that allow your program to compile. Here are the instructions in netbeans.conf: # Note that default -Xmx and -XX:MaxPermSize are selected for you automatically. # You can find these values in var/log/messages.log file in … Read more

Unicode characters in app doesn’t show correctly [closed]

At run-time, we can use Font.canDisplayUpTo(String) to determine which of the installed fonts can display a given text. Logical fonts such as Font.SANS_SERIF and Font.SERIF typically are made of of other fonts and can cover vast ranges of different scripts. Here is an example using the given text, with the results seen on this machine. … Read more

how to create a remote session EJB from a client

I started from scratch. The only difference I can think of is that instead of making an EJB application, I just made an EJB module for the bean. Otherwise, I think it’s the same. structure: thufir@dur:~/NetBeansProjects$ thufir@dur:~/NetBeansProjects$ tree HelloLibrary/ HelloLibrary/ ├── build.xml ├── nbproject │   ├── build-impl.xml │   ├── genfiles.properties │   ├── private │   │   … Read more

querying embedded database in netbeans using derby

You told us I have created an embedded database … and added data to it. Thus, this database must be visible in Netbeans Services. NO ;create=true ! You should connect with the same URL you see in the properties. Nothing more. Expand Database URL or look at the bottom. con = DriverManager.getConnection(“jdbc:derby:C:/Dokumente und Einstellungen/Administrator/.netbeans-derby/sample”,”app”,”app”); In … Read more

Where is Visual Web Editor for JavaServer Faces on Netbeans

That’s the UI editor of the already since ~3 years dead and abandoned Woodstock library . That library became an epic failure due to an bug which revealed when Firefox 3 was released. It turned out that the library generates non-standards compliant Javascript which broke in the newer and more standards-compliant browsers. It was a … Read more

Change JRE in a NetBeans project

In the Project tab, right-click on the project and select Properties. In the Library category select Java Platform JDK 1.6. Then, in the Source category select Source/Binary Format JDK6. This assumes that you installed JDK 1.6 and NetBeans knows about this. JDK 1.6 must be known to NetBeans as a Java Platform. From the menu … Read more

Glassfish error when producing JSON

It’s a bug in Glassfish 4.1.1 https://java.net/jira/browse/JERSEY-2888 I was able to fix it in a dirty way: In glassfish/modules/org.eclipse.persistence.moxy.jar fix META-INF/MANIFEST.MF Just append the following to Import-Package: ,org.xml.sax.helpers,javax.xml.parsers;resolution:=optional,javax.naming;resolution:=optional so it looks like after: and restart GF btw: you can easy edit jars in terminal with emacs org.eclipse.persistence.moxy.jar

tech