Search Results

Search found 32789 results on 1312 pages for 'object relational mapping'.

Page 66/1312 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • Serializable object in intent returning as String

    - by B_
    In my application, I am trying to pass a serializable object through an intent to another activity. The intent is not entirely created by me, it is created and passed through a search suggestion. In the content provider for the search suggestion, the object is created and placed in the SUGGEST_COLUMN_INTENT_EXTRA_DATA column of the MatrixCursor. However, when in the receiving activity I call getIntent().getSerializableExtra(SearchManager.EXTRA_DATA_KEY), the returned object is of type String and I cannot cast it into the original object class. I tried making a parcelable wrapper for my object that calls out.writeSerializable(...) and use that instead but the same thing happened. The string that is returned is like a generic Object toString(), i.e. com.foo.yak.MyAwesomeClass@4350058, so I'm assuming that toString() is being called somewhere where I have no control. Hopefully I'm just missing something simple. Thanks for the help! Edit: Some of my code This is in the content provider that acts as the search authority: //These are the search suggestion columns private static final String[] COLUMNS = { "_id", // mandatory column SearchManager.SUGGEST_COLUMN_TEXT_1, SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA }; //This places the serializable or parcelable object (and other info) into the search suggestion private Cursor getSuggestions(String query, String[] projection) { List<Widget> widgets = WidgetLoader.getMatches(query); MatrixCursor cursor = new MatrixCursor(COLUMNS); for (Widget w : widgets) { cursor.addRow(new Object[] { w.id w.name w.data //This is the MyAwesomeClass object I'm trying to pass }); } return cursor; } This is in the activity that receives the search suggestion: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Object extra = getIntent().getSerializableExtra(SearchManager.EXTRA_DATA_KEY); //extra.getClass() returns String, when it should return MyAwesomeClass, so this next line throws a ClassCastException and causes a crash MyAwesomeClass mac = (MyAwesomeClass)extra; ... }

    Read the article

  • Setting up path mapping in PHP and Eclipse

    - by jax
    I have just setup my website locally so I can test my pages more easily. Eclipse has been configured to use an XAMPP server locally. The problem is that I want to map my project to a certain place in my website. ie. In my Eclipse PHP project I have a folder called com I want this to map to /com in the webstie. I tried to do this in the mapping section of the Eclipse server setup but it didn't work. When I type http://localhost/com/ It should go to my project folder, however, when I type other folder it should use the normal website folders. how can I do this?

    Read the article

  • Does an HttpHandler require an aspnet_isapi.dll mapping

    - by DEH
    Hi, If I configure (via web.config) an httphandler to handle all .gif requests for a specific folder, is it absolutely essential for me to map .gif requests to aspnet_isapi.dll in IIS? Is there any other way of ensuring that the .gif http request will be handled by aspnet_isapi.dll? I have a server configured where the virtual dir that contained the .gif-aspnet_isapi.dll mapping has been deleted, but the .gif requests are still being passed to the handler. Anyone know how this might be being done, and where the setting might be lurking? Thanks

    Read the article

  • How can a JSON object refer to values in itself?

    - by Erin Drummond
    Hi, Lets say I have the following javascript: var obj = { key1 : "it ", key2 : key1 + " works!" }; alert(obj.key2); This errors with "key1 is not defined". I have tried this.key1 this[key1] obj.key1 obj[key1] this["key1"] obj["key1"] and they never seem to be defined. How can I get key2 to refer to key1's value?

    Read the article

  • Arrays of Objects: For each element in array 1, does an object value exist as a value in any of the objects in array 2

    - by DevOtts
    I have two arrays which contain objects in each element of the array. var array1 = [{firstName: "John", lastName: "McDonald"}, {firstName: "Sandy", lastName: "Johnson"},....,] var array2 = [{userName: "Donald"}, {userName: "John"},....,] In psuedo-code, I want to do the following: for each element in array1, is array1[i].firstName == to any of the userName's in array2. In plain english I want to look at each firstname in array1 and see if it exists at all in array2 as the value associated with the userName property.

    Read the article

  • How to signal object instantiation in a Collaboration/Communication Diagram?

    - by devoured elysium
    I'd like to know how to translate the following line of code to a Collaboration Diagram: Food food = new Food("abc", 123); I know that I can call an Food's method using the following notation: MyStaticMethod() ----------------------> -------- | | | Food | | | -------- being that equivalent to Taste taste = Food.MyStaticMethod(); and MyInstanceMethod() ----------------------> --------------- | | | food : Food | | | --------------- is equivalent to food.MyInstanceMethod(); but how do I signal that I want to call a given constructor on Food? Thanks

    Read the article

  • Repository, Service or Domain object - where does logic belong?

    - by betitall
    Take this simple, contrived example: UserRepository.GetAllUsers(); UserRepository.GetUserById(); Inevitably, I will have more complex "queries", such as: //returns users where active=true, deleted=false, and confirmed = true GetActiveUsers(); I'm having trouble determining where the responsibility of the repository ends. GetActiveUsers() represents a simple "query". Does it belong in the repository? How about something that involves a bit of logic, such as: //activate the user, set the activationCode to "used", etc. ActivateUser(string activationCode);

    Read the article

  • In java can i have more than one class/object in a file?

    - by David
    So the way i've been told to do things is you have your file and the file name is Classname.java and then the code is something like this: class ClassName { SOME METHODS main {} } and then thats all. I'd like to have two objects defined and used within the same .java file. (i don't want to have to put the other class in a difernt file just because i'd like to send this to someone and i want to avoid hasstle of atatching multiple files to an email [the lazy do make good programers though if you think about it]) is it possible to do this? do i have to do anything special and if so what? what are some mistakes i'm likely to make or that you have made in the past when doing this?

    Read the article

  • Object inside of array -- works in one scope but not in another?

    - by Earlz
    Ok I've been learning some of the more advanced aspects of Javascript and now trying to use this I'm stuck. Here is my code: function Data(){} function init(state){ var item; item=new Data(); item.fieldrid=17; item.description='foo'; state.push(item); }; function findInState(state,fieldrid) { for (var item in state) { alert(item.fieldrid); //prints undefined if (item.fieldrid == fieldrid) { return item; } } return null; } var s=[]; init(s); alert(s[0].fieldrid); //prints 17 (expected) alert(findInState(s,17).fieldrid); //exception here. function returns null. A running example is here at jsbin Why does this not work? I would expect the alert in findInState to yield 17 but instead it yields undefined. What am I doing wrong?

    Read the article

  • Fluent mapping help

    - by Matt Thrower
    Hi, This is probably a very simple question but I'm new to nHibernate and I'm having trouble working this out. I have a Page object, which can have many Region objects. I also have a Workflow object. Page and Region objects both have a relationship to Workflow and it's this double association that I'm having trouble with. The PageMap has HasMany(Function(x) x.Regions).Cascade.All() And the RegionMap has: References(Function(x) x.Page) And this all seems to work. But how do I define the relationship between Workflow and these two objects?

    Read the article

  • Problem mapping data located in a NSMutableArray

    - by Graeme
    I have an NSMutableArray which contains some addresses which I need to map using Apple's MapKit SDK which I can't seem to get to load. The NSLog keeps telling me that the data source is (null) and a 0x0 error displays when I attempt to print out the array. Any ideas? The data is parsed and stored from another class, perhaps I'm not linking it across properly? The data is originally gathered from an RSS feed, bought into the app with an IMporter class, and then displayed in a table view. I want to be able to connect into that data with my mapping class, but am struggling to do so.

    Read the article

  • SQL Server Mapping a user to a login and adding roles programmatically

    - by user163457
    In my SQL Server 2005 server I create databases and logins using Management Studio. My application requires that I give a newly created user read and write permissions to another database. To do this I right-click the newly created login, select properties and go to User Mapping. I put a check beside the database to map this login to the db and select db_datareader and db_datawriter as the roles to map. Can this be done programmatically? I've read about using Alter User and sp_change_users_login but I'm having problems getting these to work, since sp_change_users_login has been deprecated so I'd prefer to use Alter User. Please note my understanding of SQL Server database users/logins/roles is basic

    Read the article

  • Mapping restful ajax requests to spring

    - by Diones
    I have this piece of code: @RequestMapping(value = "/test.json", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public @ResponseBody Object[] generateFile(@RequestParam String tipo) { Object[] variaveis = Variavel.getListVariavelByTipo(tipo); return variaveis; } As far as I know it should take a request to test.json?tipo=H and return the JSON representation of Variavel[], however when I make such request I get: HTTP Status 406 - type Status report message descriptionThe resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers () By using the following function I can get the expected json: @RequestMapping(value = "/teste.json") public void testeJson(Model model, @RequestParam String tipo) { model.addAttribute("data", Variavel.getListVariavelByTipo("H")); } What I'm doing wrong?

    Read the article

  • How do I loop through a SimpleXML object in PHP

    - by Aditya
    I have a simpleXml object and want to read the data from the object , I am new to PHP and dont quite know how to do this. The object details are as follows. I need to read [description] and [hours]. Thankyou. SimpleXMLElement Object ( [@attributes] = Array ( [type] = array ) [time-entry] = Array ( [0] = SimpleXMLElement Object ( [date] = 2010-01-26 [description] = TCDM1 data management: sort & upload NFP SubProducers list [hours] = 1.0 [id] = 21753865 [person-id] = 350501 [project-id] = 4287373 [todo-item-id] = SimpleXMLElement Object ( [@attributes] = Array ( [type] = integer [nil] = true ) ) ) [1] = SimpleXMLElement Object ( [date] = 2010-01-27 [description] = PDCH1: HTML [hours] = 0.25 [id] = 21782012 [person-id] = 1828493 [project-id] = 4249185 [todo-item-id] = SimpleXMLElement Object ( [@attributes] = Array ( [type] = integer [nil] = true ) ) ). Please help me. I tries a lot of stuff , but not getting the syntax right.

    Read the article

  • Programming to interfaces while mapping with Fluent NHibernate.

    - by Lucious
    Fluent Mapping I Have the following scenario public class CustomerMap : ClassMap { public CustomerMap() { Table("Customer"); Id(c = c.Id); Map(c = c.Name); HasMany(c = c.Orders); } } public class OrderMap : ClassMap<IOrder> { public OrderMap() { Table("Orders"); References(o => o.Customer).Access.; Id(o => o.Id); Map(o => o.DateCreated); } } Problems When schema exported the order table has two columns ICustomer_Id,Customer_Id. refers to an unmapped class Order exception Can you please help me out?

    Read the article

  • Looping through a SimpleXML object

    - by Aditya
    I have a simpleXml object and want to read the data from the object , I am new to PHP and dont quite know how to do this. The object details are as follows. I need to read [description] and [hours]. Thankyou. SimpleXMLElement Object ( [@attributes] = Array ( [type] = array ) [time-entry] = Array ( [0] = SimpleXMLElement Object ( [date] = 2010-01-26 [description] = TCDM1 data management: sort & upload NFP SubProducers list [hours] = 1.0 [id] = 21753865 [person-id] = 350501 [project-id] = 4287373 [todo-item-id] = SimpleXMLElement Object ( [@attributes] = Array ( [type] = integer [nil] = true ) ) ) [1] = SimpleXMLElement Object ( [date] = 2010-01-27 [description] = PDCH1: HTML [hours] = 0.25 [id] = 21782012 [person-id] = 1828493 [project-id] = 4249185 [todo-item-id] = SimpleXMLElement Object ( [@attributes] = Array ( [type] = integer [nil] = true ) ) ). Please help me. I tries a lot of stuff , but not getting the syntax right.

    Read the article

  • How to serialize a Linq to Sql object graph without hiding the child's "Parent" member

    - by Richard B
    Without hiding the Child object's reference to the Parent object, has anyone been able to use an XmlSerializer() object to move a Linq to SQL object to an XML document, or is the only appropriate way of handling this to create a custom serialization/deserialization class to handle moving the data to/from the xml document? I don't like the idea of hiding the child object's reference to the parent object is why I'm asking. Thx.

    Read the article

  • No mapping for LONGVARCHAR in Hibernate 3.2

    - by jimbokun
    I am running Hibernate 3.2.0 with MySQL 5.1. After updating the group_concat_max_len in MySQL (because of a group_concat query that was exceeding the default value), I got the following exception when executing a SQLQuery with a group_concat clause: "No Dialect mapping for JDBC type: -1" -1 is the java.sql.Types value for LONGVARCHAR. Evidently, increasing the group_concat_max_len value causes calls to group_concat to return a LONGVARCHAR value. This appears to be an instance of this bug: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3892 I guess there is a fix for this issue in Hibernate 3.5, but that is still a development version, so I am hesitant to put it into production, and don't know if it would cause issues for other parts of my code base. I could also just use JDBC queries, but then I have to replace every instance of a SQLQuery with a group_concat clause. Any other suggestions?

    Read the article

  • Efficient way to access a mapping of identifiers in Python

    - by sixbelo
    I am writing an app to do a file conversion and part of that is replacing old account numbers with a new account numbers. Right now I have a CSV file mapping the old and new account numbers with around 30K records. I read this in and store it as dict and when writing the new file grab the new account from the dict by key. My question is what is the best way to do this if the CSV file increases to 100K+ records? Would it be more efficient to convert the account mappings from a CSV to a sqlite database rather than storing them as a dict in memory?

    Read the article

  • Mapping LINQ to SQL table to another very similar table without iterating through every one

    - by Daniel Coffman
    Apologies for the vague question. Here it is: I have a table object created by LINQ to SQL. I am copying entries from one table to an "archive" table that has all the columns of the original, plus a couple extra ones. It feels sloppy to iterate through every object and manually define the mapping like: foreach (oldTable in dbContextOldTables) { var newTable = new NewTable(); newTable.TableID = oldTable.ID; newTable.Title = oldTable.Title; ... (repeat for twenty columns) newTable.ColumnThatIsntInOldTable = "Data that will be the same for every row"; dbContext.NewTables.InsertOnSubmit(newTable); } dbContext.SubmitChanges(); Is there a clever way to do this?

    Read the article

  • [PHP] How to unset object's inherited properties ?

    - by vbklv
    I have an Object ( [id] => 1 [parent_id] => 0 [result:Database:private] => [db:Database:private] => mysqli Object ( [affected_rows] => 0 ... ) ) Obviously, the Object has inherited the 'db' and 'result' properties of the parent Database class. unset($object-result) nor unset($object-result:Database) nor unset($object-result:Database:private) work. How could I unset those properties when they are no longer needed (i.e. when the object properties are about to be output)? Is it a generally a good idea to have a database object as an inherited property of other classes (extend one Database class with all other classes that use database connections)?

    Read the article

  • Mapping C structure to an XML element

    - by EFraim
    Suppose I have a structure in C or C++, such as: struct ConfigurableElement { int ID; char* strName; long prop1; long prop2; ... }; I would like to load/save it to/from the following XML element: <ConfigurableElement ID="1" strName="namedElem" prop1="2" prop2="3" ... /> Such a mapping can be trivially done in Java/C# or any other language with run-time reflection for the matter. Can it be done in any non-tedious way in C++ with macros/template trickery? Bonus points for handling nested structures/unions.

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >