This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url: https://nullpointerexception1.wordpress.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.dropwizard.Application; | |
import io.dropwizard.setup.Environment; | |
/** | |
* Created by harshvardhan on 12/07/18. | |
*/ | |
public class MyApplication extends Application<MyConfiguration> { | |
public static void main(String[] args) throws Exception { | |
new MyApplication().run(args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.codahale.metrics.annotation.Timed; | |
import javax.ws.rs.GET; | |
import javax.ws.rs.POST; | |
import javax.ws.rs.Path; | |
/** | |
* Created by harshvardhan on 12/07/18. | |
*/ | |
@Path("/resource") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.dropwizard.Application; | |
import io.dropwizard.setup.Environment; | |
/** | |
* Created by harshvardhan on 12/07/18. | |
*/ | |
public class MyApplication extends Application<MyConfiguration> { | |
public static void main(String[] args) throws Exception { | |
new MyApplication().run(args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.wordpress.nullpointerexception1</groupId> | |
<artifactId>myRestProject</artifactId> | |
<version>1.0-SNAPSHOT</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `info` ( | |
`name` varchar(50) NOT NULL DEFAULT '', | |
`empid` varchar(50) NOT NULL DEFAULT '', | |
PRIMARY KEY (`empid`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models; | |
import lombok.Data; | |
import javax.persistence.*; | |
/** | |
* Created by harshvardhan on 10/07/18. | |
*/ | |
@Entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.dropwizard.hibernate.AbstractDAO; | |
import org.hibernate.SessionFactory; | |
import java.util.List; | |
/** | |
* Created by harshvardhan on 10/07/18. | |
*/ | |
public class InfoDao extends AbstractDAO<Info> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.fasterxml.jackson.annotation.JsonProperty; | |
import io.dropwizard.Configuration; | |
import io.dropwizard.db.DataSourceFactory; | |
/** | |
* Created by harshvardhan on 12/07/18. | |
*/ | |
public class MyConfiguration extends Configuration { | |
private String url; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.dropwizard.Application; | |
import io.dropwizard.db.DataSourceFactory; | |
import io.dropwizard.hibernate.HibernateBundle; | |
import io.dropwizard.setup.Environment; | |
/** | |
* Created by harshvardhan on 12/07/18. | |
*/ | |
public class MyApplication extends Application<MyConfiguration> { |