当前位置: 首页>>代码示例>>Java>>正文


Java Booking类代码示例

本文整理汇总了Java中com.acmeair.entities.Booking的典型用法代码示例。如果您正苦于以下问题:Java Booking类的具体用法?Java Booking怎么用?Java Booking使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Booking类属于com.acmeair.entities包,在下文中一共展示了Booking类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBookingByNumber

import com.acmeair.entities.Booking; //导入依赖的package包/类
@GET
@Path("/bybookingnumber/{userid}/{number}")
@Produces(MediaType.APPLICATION_JSON)
public BookingInfo getBookingByNumber(
        @PathParam("number") String number,
        @PathParam("userid") String userid) {
    try {
        Booking b = bs.getBooking(userid, number);
        BookingInfo bi = null;
        if (b != null) {
            bi = new BookingInfo(b);
        }
        return bi;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:19,代码来源:BookingsREST.java

示例2: getBookingsByUser

import com.acmeair.entities.Booking; //导入依赖的package包/类
@GET
@Path("/byuser/{user}")
@Produces(MediaType.APPLICATION_JSON)
public List<BookingInfo> getBookingsByUser(@PathParam("user") String user) {
    try {
        List<Booking> list = bs.getBookingsByUser(user);
        List<BookingInfo> newList = new ArrayList<BookingInfo>();
        for (Booking b : list) {
            newList.add(new BookingInfo(b));
        }
        return newList;
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:17,代码来源:BookingsREST.java

示例3: bookFlight

import com.acmeair.entities.Booking; //导入依赖的package包/类
@Transactional(propagation=Propagation.REQUIRED)
@Override
public BookingPK bookFlight(String customerId, FlightPK flightId) {
	try {
		// We still delegate to the flight and customer service for the map
		// access than getting the map instance directly
		Flight f = flightService.getFlightByFlightKey(flightId);
		Customer c = customerService.getCustomerByUsername(customerId);

		Booking newBooking = new Booking(keyGenerator.generate().toString(), new Date(), c, f);
		BookingPK key = newBooking.getPkey();

		em.persist(newBooking);
		
		return key;
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:Hellaenergy,项目名称:openshift-acmeair,代码行数:20,代码来源:BookingServiceImpl.java

示例4: BookingInfo

import com.acmeair.entities.Booking; //导入依赖的package包/类
public BookingInfo(Booking booking){
	this.bookingId = booking.getBookingId();
	this.flightId = booking.getFlightId();
	this.customerId = booking.getCustomerId();
	this.dateOfBooking = booking.getDateOfBooking();
	this.pkey = new BookingPKInfo(this.customerId, this.bookingId);
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:8,代码来源:BookingInfo.java

示例5: getBooking

import com.acmeair.entities.Booking; //导入依赖的package包/类
@Override
public Booking getBooking(String user, String bookingId) {
    try {
        return bookingRepository.findOne(bookingId);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:9,代码来源:BookingServiceImpl.java

示例6: getBookingsByUser

import com.acmeair.entities.Booking; //导入依赖的package包/类
@Override
public List<Booking> getBookingsByUser(String user) {
    try {
        List<BookingImpl> bookingImpls = bookingRepository.findByCustomerId(user);
        List<Booking> bookings = new ArrayList<Booking>();
        for (Booking b : bookingImpls) {
            bookings.add(b);
        }
        return bookings;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:14,代码来源:BookingServiceImpl.java

示例7: getsBookingOfSpecifiedUser

import com.acmeair.entities.Booking; //导入依赖的package包/类
@Test
public void getsBookingOfSpecifiedUser() {
    when(bookingRepository.findByCustomerId(booking.getCustomerId())).thenReturn(singletonList(booking));

    List<Booking> bookings = bookingService.getBookingsByUser(booking.getCustomerId());

    assertThat(bookings, contains(booking));
}
 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:9,代码来源:BookingServiceImplTest.java

示例8: getBookingsByUser

import com.acmeair.entities.Booking; //导入依赖的package包/类
@Override
public List<Booking> getBookingsByUser(String user) {
	Query q = em.createQuery("SELECT obj FROM Booking obj where obj.customer.id=?1");
	q.setParameter(1, user);

	List<Booking> results = (List<Booking>) q.getResultList();	
	
	return results;
}
 
开发者ID:Hellaenergy,项目名称:openshift-acmeair,代码行数:10,代码来源:BookingServiceImpl.java

示例9: cancelBooking

import com.acmeair.entities.Booking; //导入依赖的package包/类
@Transactional(propagation=Propagation.REQUIRED)
@Override
public void cancelBooking(String user, String id) {
	Booking booking = getBooking(user, id);
	if (booking != null) {
		em.remove(booking);
	}
}
 
开发者ID:Hellaenergy,项目名称:openshift-acmeair,代码行数:9,代码来源:BookingServiceImpl.java

示例10: getBookingByNumber

import com.acmeair.entities.Booking; //导入依赖的package包/类
@GET
@Path("/bybookingnumber/{userid}/{number}")
@Produces("application/json")
public Booking getBookingByNumber(
		@PathParam("number") String number,
		@FormParam("userid") String userid) {
	try {
		Booking b = bs.getBooking(userid, number);
		return b;
	}
	catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:Hellaenergy,项目名称:openshift-acmeair,代码行数:16,代码来源:BookingsREST.java

示例11: getBookingsByUser

import com.acmeair.entities.Booking; //导入依赖的package包/类
@GET
@Path("/byuser/{user}")
@Produces("application/json")
public List<Booking> getBookingsByUser(@PathParam("user") String user) {
	try {
		return bs.getBookingsByUser(user);
	}
	catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:Hellaenergy,项目名称:openshift-acmeair,代码行数:13,代码来源:BookingsREST.java

示例12: getBooking

import com.acmeair.entities.Booking; //导入依赖的package包/类
@Override
public Booking getBooking(String user, String id) {
	BookingPK key = new BookingPK(user, id);
	return em.find(Booking.class, key);
}
 
开发者ID:Hellaenergy,项目名称:openshift-acmeair,代码行数:6,代码来源:BookingServiceImpl.java

示例13: getBooking

import com.acmeair.entities.Booking; //导入依赖的package包/类
Booking getBooking(String user, String id); 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:2,代码来源:BookingService.java

示例14: getBookingsByUser

import com.acmeair.entities.Booking; //导入依赖的package包/类
List<Booking> getBookingsByUser(String user); 
开发者ID:WillemJiang,项目名称:acmeair,代码行数:2,代码来源:BookingService.java

示例15: getBooking

import com.acmeair.entities.Booking; //导入依赖的package包/类
public abstract Booking getBooking(String user, String id); 
开发者ID:Hellaenergy,项目名称:openshift-acmeair,代码行数:2,代码来源:BookingService.java


注:本文中的com.acmeair.entities.Booking类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。