我正在尝试使用Spring编写SOAP服务,但是我收到了依赖注入问题.我@Autowired
通过服务使用这样的问题:
public interface UserDao {
User getUser(String username);
}
Run Code Online (Sandbox Code Playgroud)
Dao的实施如下:
@Controller("userDao")
public class UserDaoImpl implements UserDao {
private static Log log = LogFactory.getLog(UserDaoImpl.class);
@Autowired
@Qualifier("sessionFactory")
private LocalSessionFactoryBean sessionFactory;
@Override
public User getUser(String username) {
Session session = sessionFactory.getObject().openSession();
// Criteria query = session.createCriteria(Student.class);
Query query = session
.createQuery("from User where username = :username");
query.setParameter("username", username);
try {
System.out.println("\n Load Student by ID query is running...");
/*
* query.add(Restrictions.like("id", "%" + id + "%",
* MatchMode.ANYWHERE)); return (Student) query.list(); …
Run Code Online (Sandbox Code Playgroud) 目前我正在开发一个Android应用程序.根据我的收集数据,我有一个位置列表(不是地址) - 只有位置名称(例如餐馆名称,度假村,海滩......),我想在Google Map API上找到每个位置的地址,如下所示图片:
我怎么能这样做?
在这种情况下,我感谢您的帮助.谢谢.
我也在寻找一种方法,但我只找到了从特定地址获得纬度或经度的解决方案.
我实现如下代码但不能返回结果:(
Geocoder coder = new Geocoder(this);
List<Address> address;
try {
String locationName = "Nhà hàng Blanchy Street, VietNam";
Geocoder gc = new Geocoder(this);
List<Address> addressList = coder.getFromLocationName(locationName, 5);
Address location = addressList.get(0);
double latitude = location.getLatitude();
double longitude = location.getLongitude();
LatLng sydney = new LatLng(latitude , longitude );
map.setMyLocationEnabled(true);
map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));
Run Code Online (Sandbox Code Playgroud)