Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Spring getting voucherPin
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


samuel
getting voucherPin
0 Answer(s)      a year and 3 months ago
Posted in : Spring


I am doin an online credit topup application..and i need a method to fetch and decrypt the voucherpin from Database..

this is my voucher repository Class.

public interface VoucherRepository extends JpaRepository<Voucher, Long>{
    @Query("from voucher v where v.category = :category and v.voucherType = :type and v.denomination = :denomination")
    public String getVoucherPinByCategoryTypeDeno(@Param("category") String category,@Param("voucherType") String type, @Param("denomination") double denomination);
}

this is the voucherService class

public interface VoucherService {

    public String getVoucherPinByCategoryTypeDeno(String category,String type,double denomination);

   //decrypts voucher before being sent.
    public String decryptVoucher();

public void listVoucherTypeImages( String url []);

} this is the implementation

public class VoucherServiceImpl implements VoucherService {

    private VoucherRepository voucherRepository;
    //gets the voucher by category,type and denomination
    @Override
    public String getVoucherPinByCategoryTypeDeno(String category, String type, double denomination) {

        return voucherRepository.getVoucherPinByCategoryTypeDeno(category, type, denomination);
    }

this is my voucherModel Class

@Entity
public class Voucher {

    //declaration of variables with their annotations to map attributes of a voucher
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "voucher_id")
    private Long voucherId;

    @Column(name = "category_id")
    @OneToOne(mappedBy = " Voucher ")
    private VoucherCategory voucherCategory;

    @Column(name = "serial_number")
    private String serialNumber;

    @Column(name = "pin")
    private String pin;

    @Column(name="voucher_type_id")
    @OneToOne
    private VoucherType voucherTypeId;

    @Column(name = "voucher_status_id")
    @OneToOne
    private VoucherStatus statusId;

    @Column(name = "denomination")
    private double denomination;

    @Column(name = "session_lock")
    private Integer sessionLock;

    @Column(name = "updated_by")
    private String updatedBy;

    @Column(name = "expiry_date")
    private String expiryDate;

    @Column(name = "last_modified")
    @Temporal(javax.persistence.TemporalType.DATE)
    private String dateModified;

    @Column(name = "date_entered")
    @Temporal(javax.persistence.TemporalType.DATE)
    private String dateEntered;

    public Long getVoucherId() {
        return voucherId;
    }

    public void setVoucherId(Long voucherId) {
        this.voucherId = voucherId;
    }

    public VoucherCategory getVoucherCategory() {
        return voucherCategory;
    }

    public void setVoucherCategory(VoucherCategory voucherCategory) {
        this.voucherCategory = voucherCategory;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public double getDenomination() {
        return denomination;
    }

    public void setDenomination(double denomination) {
        this.denomination = denomination;
    }

    public String getDateEntered() {
        return dateEntered;
    }

    public void setDateEntered(String dateEntered) {
        this.dateEntered = dateEntered;
    }

    public String getExpiryDate() {
        return expiryDate;
    }

    public void setExpiryDate(String expiryDate) {
        this.expiryDate = expiryDate;
    }

    public String getPin() {
        return pin;
    }

    public void setPin(String pin) {
        this.pin = pin;
    }

    public VoucherStatus getStatusId() {
        return statusId;
    }

    public void setStatusId(VoucherStatus statusId) {
        this.statusId = statusId;
    }

    public Integer getSessionLock() {
        return sessionLock;
    }

    public void setSessionLock(Integer sessionLock) {
        this.sessionLock = sessionLock;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public String getDateModified() {
        return dateModified;
    }

    public void setDateModified(String dateModified) {
        this.dateModified = dateModified;
    }
}

Advertisement
View Answers

Related Tutorials/Questions & Answers:
getting voucherPin
getting voucherPin  I am doin an online credit topup application..and i need a method to fetch and decrypt the voucherpin from Database.. this is my voucher repository Class. public interface VoucherRepository extends
Getting Exception
Getting Exception  How to get exception from commented code in java
Advertisements
getting variables
getting variables   how to get variables from servlet program to webservice program
getting the emplo
getting the emplo   I have one table "EMPLOYEEMASTER" contains 'emp id', 'employee name' for eg: emp id employee name... kumar i want the sql statement for getting like emp id
Getting NumberFormatException
Getting NumberFormatException  Thanks for the reply. Its works well, but whenever I'm using numeric value from 0010 to 0757 it is returning some garbage value. I dont have the idea what is going wrong. Please give me some idea
Getting NumberFormatException
Getting NumberFormatException  Hello Sir, I'm using Integer.parseInt(String str) function which returns a NumberFormatException(Unknown source). I also used Integer.parseInt(String str, int radix) but it also throws the exception
getting errors
getting errors  public class positive { public static void main(String[] args) { retainPositiveNumbers(a); } private static int n; private static int j; static int a[]={-1,2,3,4,-5}; static int
Getting an error :(
Getting an error :(  I implemented the same code as above.. But getting this error in console... Console Oct 5, 2012 10:18:14 AM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server
Getting around in Agra
Getting around in Agra  Hi, I am looking for complete information on getting around in Agra? Thanks
getting html list in a array
getting html list in a array  hi i want to get html unordered list in a array using jsp
GETTING ALERT MESSAGE
GETTING ALERT MESSAGE  how to get an alert message when radio button is selected instead of checkbox
Getting mysql table in textbox
Getting mysql table in textbox  how to get mysql table values into textbox in java using ajax and servlets
getting html list in a array
getting html list in a array  hi i want to get html unordered list in a array using jsp
getting files from VSS
getting files from VSS  I am not able to get the files from VSS.I am using following code. and just let me know is localpath attribute is for our local project path? I am getting the problem in this line failed
Getting an exception - JSP-Servlet
Getting an exception  Dear Sir , While sending a mail am getting an following exception javax.mail.MessagingException: 554 mail server permanently rejected message (#5. 3.0)so how to over come from this please help
getting coords from an image.
getting coords from an image.  how to get coordinates dynamically(in run time) from an image?? pls help me
GETTING AN ALERT MESSAGE
GETTING AN ALERT MESSAGE  how to get an alert message, if i select radio button instead of checkbox(associated with 3 dropdown list
Getting the string in reverse
Getting the string in reverse  i am giving the string=" i am sachin".for this output is "sachin am i".please give me the code?   Hi Friend, Visit Here Thanks
Getting Error - Development process
Getting Error   Hi , i am getting error while executing this code. I just want to store date in to database. Dont mistake me for repeated questions. java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Number
Getting an exception - JSP-Servlet
Getting an exception  thanks sir for u r reply ,but i already added that jar file sir even though i m getting an exception sir please help me sir ... thanks in advance..  Hi Friend, You can do one thing, replace
Date not getting in proper format
Date not getting in proper format  import java.util.*; class Date { public static void main(String[]args) { Date d = new Date(100000000000L); System.out.print("1st date"+d.toString()); } } out put:- 1st date@3e25
about getting the hour time
about getting the hour time  if i want to say, if the hour shows before noon, display message "good morning" and if otherwise, display "good afternoon" and so on..and im using tag..the problem is i dont know the code for Good
problem getting password - JavaMail
problem getting password  hi i am trying to get password but igot following error Error sending mail:javax.mail.MessagingException: Could not connect to SMTP host: 192.168.10.14, port: 25;nested exception
Getting IP Address
Getting IP Address  Hi... i want to get the ip address of the current machine running my jsp program.... example: my ip is 172.16.11.247... from other system if i run my jsp program using my ip like 172.16.11.247/myfile.jsp i
Getting IP Address
Getting IP Address  Hi... i want to get the ip address of the current machine running my jsp program.... example: my ip is 172.16.11.247... from other system if i run my jsp program using my ip like 172.16.11.247/myfile.jsp i
Getting Computer Date in java
Getting Computer Date in java  Hi , I want to get the PC Date and insert it to a DB, specifically MSSQL.. Everything in my scriptlet works but this.. String strDate = new Date(); I get this server error, "The type Date
Getting garbage value
Getting garbage value  Thanks for the reply. Its works well, but whenever I'm using numeric value from 0010 to 0757 it is returning some garbage value. I dont have the idea what is going wrong. Please give me some idea to solve
Getting an exception - JSP-Servlet
Getting an exception  sir i used u r code for sending a mass email by reading an excel sheet,but i am getting a following error so please help me if any changes in code . thanks in advance.. java.io.IOException: Invalid
getting random number in java
getting random number in java  getting random number in java Hi everyone, i am trying to get a random number in a particular range. for example random numbers between 1 to 100 in Java. Though i m new to Java, i have tried many
Getting an exception - JSP-Servlet
Getting an exception  sir i used u r code for sending a mass email by reading an excel sheet,but i am getting a following error so please help me if any changes in code . thanks in advance.. java.io.IOException: Invalid
getting db in action class
getting db in action class  hi, Am usin struts in ma application... n i need to interact with the db .. so i used.. getDataSource(request) but it gives me an error.. java.lang.NoSuchMethodError: LoginAction.getDataSource(Ljavax
 

 

 

DMCA.com