Monthly Archives: August 2013

Simple ajax call Jquery

This is plain Ajax call with success and error function.

you can write this ajax in any of your method and perform actions.



Code:
/* get some values from elements on the page: */

var username= $('#username').val();
var pass=$('#pass').val();
//parameters to pass
var data = {
username : username,
pass:pass
};
//authenticateUser is the action which you need to call
var testUrl = "authenticateUser";
$.ajax({
url : testUrl,
type : 'post',
data : data,
dataType : 'json',
success : function(data) {
//success action Block
alert("Login success");
},
error:function(){
//Error action block
alert("Login failed");
}
});

60 total views, no views today

Hibernate dialects

DB2 – org.hibernate.dialect.DB2Dialect

HypersonicSQL – org.hibernate.dialect.HSQLDialect

Informix – org.hibernate.dialect.InformixDialect

Ingres – org.hibernate.dialect.IngresDialect

Interbase – org.hibernate.dialect.InterbaseDialect

Pointbase – org.hibernate.dialect.PointbaseDialect

PostgreSQL – org.hibernate.dialect.PostgreSQLDialect

Mckoi SQL – org.hibernate.dialect.MckoiDialect

Microsoft SQL Server – org.hibernate.dialect.SQLServerDialect

MySQL – org.hibernate.dialect.MySQLDialect

Oracle (any version) – org.hibernate.dialect.OracleDialect

Oracle 9 – org.hibernate.dialect.Oracle9Dialect

Progress – org.hibernate.dialect.ProgressDialect

FrontBase – org.hibernate.dialect.FrontbaseDialect

SAP DB – org.hibernate.dialect.SAPDBDialect

Sybase – org.hibernate.dialect.SybaseDialect

Sybase Anywhere – org.hibernate.dialect.SybaseAnywhereDialect

62 total views, no views today

org.hibernate.AnnotationException: No identifier specified for entity:


Problem :
org.hibernate.AnnotationException: No identifier specified for entity:

Solution:

You are missing a field annotated with @Id. Each @Enitity needs an @Id – this is the primary key in the database.

If you don’t want your entity to be persisted in a separate table, but rather be a part of other entities, you can use @Embeddable instead of @Entity.

55 total views, no views today

Run a specific test case in Maven

There are cases when you want to run some specific test cases as many test cases are failing and breaking your build and you just want to check your test case , So you can do this by a simple maven command.

Maven command:

mvn -Dtest=TestClass#abcMethod test


WhereĀ 

TestClass is the test class nameĀ 
abcMethod is the test method

65 total views, no views today

Maven skip test cases

If you want to skip test cases in your maven project then follow these steps.

1. Navigate to your repository location where pom.xml file is present.
2. Open cmd prompt.
3. Run below command and it will skip all test cases

command:
mvn clean install -DskipTests=true -Dmaven.test.failure.ignore=true

This command just skip your test cases and build your project.

61 total views, no views today