while(cursor.moveToNext()) { result = new Phone(); result.id = (cursor.getInt(0)); result.phone = phone; result.isBlocked = true; }
if(cursor!=null){ cursor.moveToFirst() result = new Phone(); result.id = (cursor.getInt(0)); //TODO : print ID_KEY to check result... }
/** * Create an instance of {@link Phone } * */ public Phone createPhone() { return new Phone(); }
import com.google.gson.annotations.SerializedName; public class UserObject{ @SerializedName("name") public String name; @SerializedName("email") public String email; @SerializedName("phone") public PhoneObject phone; public UserObject(){ phone=new Phone(); } }
Set<Phone> phoneNumbers = new HashSet<Phone>(); Phone p1 = new Phone("house", "32354353"); phoneNumbers.add(p1); Phone p2 = new Phone("mobile", "9889343423"); phoneNumbers.add(p2); Student student = new Student("Eswar", phoneNumbers); student.setPhones(phoneNumbers); session.save(student); //Till now, This code is work if you use cascade = 'all' in //my_mapping_file.xml or session.save(p1); session.save(p2); //call session.save on both phone objects
@Override public void setAsText(String textValue) throws IllegalArgumentException { final String stripped = stripNonNumeric(textValue); final String areaCode=stripped.substring(0,3); final String prefix=stripped.substring(3,6); final String number=stripped.substring(6); final Phone phone=new Phone(areaCode,prefix,number); setValue(phone); }
public static Entry loadEntry (Scanner sc) { if (s.hasNextLine()) { String[] temp = s.nextLine().split("\\s"); //assuming file contains 'Gavrilo Aleksic 012 221788' Person p = new Person(temp[0], temp[1]); Phone ph = new Phone(temp[2], temp[3]); return new ENRTY(p, ph); } return null; }
public static void main(String[] args) { Phone p1 = new Phone(); p1.setNumber(); System.out.println(p1.phoneNumber); }
public static void main(String[] args) { // TODO Auto-generated method stub Phone p1 = new Phone(); p1.setNumber(); System.out.println(p1.phoneNumber); }
if(arrayClient.get(a).getNameClient().equalsIgnoreCase(nameIn)){ Phone newPhone = new Phone(); newPhone.setPhone(); arrayClient.get(a).addPhone(newPhone); }
public class Fortest { Phone name = new Phone(); public String handleUser(User user) { String ph = name.getA(); if(ph.equalsIgnoreCase("test")){ return "done"; } return "failed"; } }
Phone phone = new Phone(); //... set phone vars phone.setProfile(profile); sessionFactory.getCurrentSession().persist(profile);
public void updateStudent(){ Transaction transaction = session.beginTransaction(); Student s = (Student)session.get(Student.class, new Long(1)); Phone phone = new Phone("house", "12342342"); s.addPhone(phone); session.update(s); transaction.commit(); }
public void updateStudent(){ Transaction transaction = session.beginTransaction(); Student s = (Student)session.get(Student.class, new Long(1)); Set<Phone> phoneNumbers =s.getStudentPhoneNumbers(); Phone phone = new Phone("house", "12342342"); phone.setStudent(s); phoneNumbers.add(phone); s.setStudentPhoneNumbers(phoneNumbers); session.update(s); transaction.commit(); }
public void addPhoneNumber(Phone phone) { phone.setStudent(this); getStudentPhoneNumbers().add(phone); } public void addPhoneNumber(String type, String number) { addPhoneNumber(new Phone(type, number)); }
public static void mapContactPhones(List<org.apache.juddi.model.Phone> modelPhoneList, List<org.uddi.api_v3.Phone> apiPhoneList) throws DispositionReportFaultMessage { apiPhoneList.clear(); for (org.apache.juddi.model.Phone modelPhone : modelPhoneList) { org.uddi.api_v3.Phone apiPhone = new org.uddi.api_v3.Phone(); apiPhone.setUseType(modelPhone.getUseType()); apiPhone.setValue(modelPhone.getPhoneNumber()); apiPhoneList.add(apiPhone); } }
public static void mapContactPhones(List<org.apache.juddi.model.Phone> modelPhoneList, List<org.uddi.api_v3.Phone> apiPhoneList) throws DispositionReportFaultMessage { apiPhoneList.clear(); for (org.apache.juddi.model.Phone modelPhone : modelPhoneList) { org.uddi.api_v3.Phone apiPhone = new org.uddi.api_v3.Phone(); apiPhone.setUseType(modelPhone.getUseType()); apiPhone.setValue(modelPhone.getPhoneNumber()); apiPhoneList.add(apiPhone); } }