Search Results

Search found 18361 results on 735 pages for 'hibernate search'.

Page 75/735 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • How to convert an ORM to its subclass using Hibernate ?

    - by Gaaston
    Hi everybody, For example, I have two classes : Person and Employee (Employee is a subclass of Person). Person : has a lastname and a firstname. Employee : has also a salary. On the client-side, I have a single HTML form where i can fill the person informations (like lastname and firstname). I also have a "switch" between "Person" and "Employee", and if the switch is on Employee I can fill the salary field. On the server-side, Servlets receive informations from the client and use the Hibernate framework to create/update data to/from the database. The mapping i'm using is a single table for persons and employee, with a discriminator. I don't know how to convert a Person in an Employee. I firstly tried to : load the Person p from the database create an empty Employee e object copy values from p into e set the salary value save e into the database But i couldn't, as I also copy the ID, and so Hibernate told me they where two instanciated ORM with the same id. And I can't cast a Person into an Employee directly, as Person is Employee's superclass. There seems to be a dirty way : delete the person, and create an employee with the same informations, but I don't really like it.. So I'd appreciate any help on that :) Some precisions : The person class : public class Person { protected int id; protected String firstName; protected String lastName; // usual getters and setters } The employee class : public class Employee extends Person { // string for now protected String salary; // usual getters and setters } And in the servlet : // type is the "switch" if(request.getParameter("type").equals("Employee")) { Employee employee = daoPerson.getEmployee(Integer.valueOf(request.getParameter("ID"))); modifyPerson(employee, request); employee.setSalary(request.getParameter("salary")); daoPerson.save(employee ); } else { Person person = daoPerson.getPerson(Integer.valueOf(request.getParameter("ID"))); modifyPerson(employee, request); daoPerson.save(person); } And finally, the loading (in the dao) : public Contact getPerson(int ID){ Session session = HibernateSessionFactory.getSession(); Person p = (Person) session.load(Person.class, new Integer(ID)); return p; } public Contact getEmployee(int ID){ Session session = HibernateSessionFactory.getSession(); Employee = (Employee) session.load(Employee.class, new Integer(ID)); return p; } With this, i'm getting a ClassCastException when trying to load a Person using getEmployee. XML Hibernate mapping : <class name="domain.Person" table="PERSON" discriminator-value="P"> <id name="id" type="int"> <column name="ID" /> <generator class="native" /> </id> <discriminator column="type" type="character"/> <property name="firstName" type="java.lang.String"> <column name="FIRSTNAME" /> </property> <property name="lastName" type="java.lang.String"> <column name="LASTNAME" /> </property> <subclass name="domain.Employee" discriminator-value="E"> <property name="salary" column="SALARY" type="java.lang.String" /> </subclass> </class> Is it clear enough ? :-/

    Read the article

  • Client-Side V.S. Server-Side Searching?

    - by user70278
    I am currently helping to design a web site and application in HTML. We would like the user to be able to search the site/app for desired content via a search bar. We would also like to include an advanced search ability to allow for different search options and more concentrated searches. We are having trouble deciding whether to program the search function on the Client-Side (with JavaScript) or on the Server-Side (with PHP). What are the pros and cons of both and what would you recommend?

    Read the article

  • Does any CMS natively support something like aquaBrowser/Vufind

    - by nus
    What I'm looking for is to set up a CMS website with a tag cloud/search system where when you click a tag it shows as a search filter, and you get a new tag cloud which only shows tags from the articles that have the primary tag. This should let the user easily include or exclude tags from the search. Also i would like to let the user filter on publication date by using a slider... Check this for an example of how aquabrowser does this (just search for something and play with the tag cloud): http://kidscatalog.columbuslibrary.org It's not perfectly what I want and I don't want to use flash, but I like the concept alot. If something like this does not exist and i might have to code it myself, which cms is most recommended (eg easy to extend, already has tag clouds and search filters,...)

    Read the article

  • Best way to build a SMART mySQL & PHP search engine?

    - by Kyle R
    What is the best way to build a mySQL & PHP search? I am currently using things like %term% I want it to be able to find the result even if they spell it slightly wrong, for example: Field value = "One: Stop Shop: They search: One Shop Stop OR One Stop Shop Etc.. I want a really smart search so they find the information even if they don't search the exact thing. What is the best way to build a smart search like this?

    Read the article

  • How to filter the jqGrid data NOT using the built in search/filter box

    - by Jimbo
    I want users to be able to filter grid data without using the intrinsic search box. I have created two input fields for date (from and to) and now need to tell the grid to adopt this as its filter and then to request new data. Forging a server request for grid data (bypassing the grid) and setting the grid's data to be the response data wont work - because as soon as the user tries to re-order the results or change the page etc. the grid will request new data from the server using a blank filter. I cant seem to find grid API to achieve this - does anyone have any ideas? Thanks.

    Read the article

  • Search algorithm (with a sort algorithm already implemented)

    - by msr
    Hello, Im doing a Java application and Im facing some doubts in which concerns performance. I have a PriorityQueue which guarantees me the element removed is the one with greater priority. That PriorityQueue has instances of class Event (which implements Comparable interface). Each Event is associated with a Entity. The size of that priorityqueue could be huge and very frequently I will have to remove events associated to an entity. Right now Im using an iterator to run all the priorityqueue. However Im finding it heavy and I wonder if there are better alternatives to search and remove events associated with an entity "xpto". Any suggestions? Thanks!

    Read the article

  • Perl Search and Replace Avoid Variable Interpolation

    - by Justin
    I'm really getting my butt kicked here. I can not figure out how to write a search and replace that will properly find this string. String: $QData{"OrigFrom"} $Text{"wrote"}: Note: That is the actual STRING. Those are NOT variables. I didn't write it. I need to replace that string with nothing. I've tried escaping the $, {, and }. I've tried all kinds of combinations but it just can't get it right. Someone out there feel like taking a stab at it? Thanks!

    Read the article

  • sequential search homework question

    - by Phenom
    Consider a disk file containing 100 records a. How many comparisons would be required on the average to find a record using sequential search, if the record is known to be in the file? I figured out that this is 100/2 = 50. b. If the record has a 68% probability of being in the file, how many comparisons are required on average? This is the part I'm having trouble with. At first I thought it was 68% * 50, but then realized that was wrong after thinking about it. Then I thought it was (100% - 68%) * 50, but I still feel that that is wrong. Any hints?

    Read the article

  • Error while configuring Sql server 2005 for full text search

    - by San
    I am trying to index a table for full text search on a SQL server 2005. When I select the change tracking as Automatic and click on the next button, I get the following error TITLE: Microsoft SQL Server This wizard will close because it encountered the following error: For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server+Management+Studio&ProdVer=9.00.4035.00&EvtSrc=Microsoft.SqlServer.Management.UI.WizardFrameworkErrorSR&EvtID=UncaughtException&LinkId=20476 ------------------------------ ADDITIONAL INFORMATION: Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476 An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) The EXECUTE permission was denied on the object 'sp_help_category', database 'msdb', schema 'dbo'. The SELECT permission was denied on the object 'sysjobs_view', database 'msdb', schema 'dbo'. (Microsoft SQL Server, Error: 229) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4035&EvtSrc=MSSQLServer&EvtID=229&LinkId=20476 ------------------------------ BUTTONS: OK

    Read the article

  • Configuring Sql server 2005 for full text search

    - by San
    I am trying to index a table for full text search on a SQL server 2005. When I select the change tracking as Automatic and click on the next button, I get the following error TITLE: Microsoft SQL Server This wizard will close because it encountered the following error: For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server+Management+Studio&ProdVer=9.00.4035.00&EvtSrc=Microsoft.SqlServer.Management.UI.WizardFrameworkErrorSR&EvtID=UncaughtException&LinkId=20476 ------------------------------ ADDITIONAL INFORMATION: Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476 An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) The EXECUTE permission was denied on the object 'sp_help_category', database 'msdb', schema 'dbo'. The SELECT permission was denied on the object 'sysjobs_view', database 'msdb', schema 'dbo'. (Microsoft SQL Server, Error: 229) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4035&EvtSrc=MSSQLServer&EvtID=229&LinkId=20476 ------------------------------ BUTTONS: OK

    Read the article

  • How to index and search subversion repository

    - by Theo Briscoe
    I have access to a very large code base stored in a subversion repository. I would like to be able to perform Google type searched on the code base. I have done this before when I have access to the server by creating a network share and using Google desktop. I currently do not have access to this subversion server box. Any Ideas? Some more info The code base is company wide and large Don't want to download the entire code base for the entire business on my laptop My goal understand what code is available inside the company The code changes often Wondering if there are any tool that can search remote svn repositories?

    Read the article

  • [SQL] Full-text search CONTAINSTABLE

    - by Alexander Vanwynsberghe
    Hello, I have a question regarding a CONTAINSTABLE function. I would like to find everything that ENDS WITH the search string. I can use the * to find everything that starts with the searchvalue, but I want an equivalent for the % sign in the SQL LIKE function. What I want: find everything that ends with 123, so as searchvalue, I could use "*123" in my CONTAINSTABLE function. But that doesn't work.. If I want all results starting with 123, I use "123*", and that works well. But what's the equivalent for -- LIKE %123 ?? it isn't "*123" in the CONTAINSTABLE function. What is it then? Thanks!

    Read the article

  • URL regex search and replace on MySQL (in WordPress)

    - by Tal Galili
    Hello all, I have a WordPress blog with numerous URL's I wish to replace from this: http://www.oldwebsite.co.il/name/*.asp To this: http://www.newwebsite.com/?p=* For example, from this: http://oldwebsite.co.il/name/65971.asp To this: http://www.newwebsite.com/?p=65971 I believe the following plugin: http://urbangiraffe.com/plugins/search-regex/ will do the trick with regex, but I am looking for the correct regex to use here. I found this stackoverflow thread that has a similar task, but since I am not too apt with regex, I was hoping for help so I don't mess anything up. Thanks, Tal After searching stackoverflow, I found

    Read the article

  • python search replace using wildcards

    - by tom smith
    hi somewhat confused.. but trying to do a search/repace using wildcards if i have something like: <blah.... ssf ff> <bl.... ssf dfggg ff> <b.... ssf ghhjj fhf> and i want to replace all of the above strings with say, <hh >t any thoughts/comments on how this can be accomplished? thanks update (thanks for the comments!) i'm missing something... my initial sample text are: Soo Choi</span>LONGEDITBOX">Apryl Berney Soo Choi</span>LONGEDITBOX">Joel Franks Joel Franks</span>GEDITBOX">Alexander Yamato and i'm trying to get Soo Choi foo Apryl Berney Soo Choi foo Joel Franks Joel Franks foo Alexander Yamato i've tried derivations of name=re.sub("</s[^>]*\">"," foo ",name) but i'm missing something... thoughts... thanks

    Read the article

  • Average performance of binary search algorithm?

    - by Passonate Learner
    http://en.wikipedia.org/wiki/Binary_search_algorithm#Average_performance BinarySearch(int A[], int value, int low, int high) { int mid; if (high < low) return -1; mid = (low + high) / 2; if (A[mid] > value) return BinarySearch(A, value, low, mid-1); else if (A[mid] < value) return BinarySearch(A, value, mid+1, high); else return mid; } If the integer I'm trying to find is always in the array, can anyone help me write a program that can calculate the average performance of binary search algorithm?

    Read the article

  • Drupal 5 Search not working on 404 pages.

    - by easement
    I have a <?php print $search_box; ?> in my page.tpl.php page. On pages that exist, the search works, but on 404 pages, it does not. I saw some bugs/patches threads over at drupal.org for D6.15, but none of them seem to work according to the thread and they weren't really relevant to D5.x I have a theory that the because the <?php print $search_box; ?> creates a form with an action to itself(a non-existant page), it'll get the 404. Has anyone run up against this? If so, how did you fix it? One theory I has was to somehow tap into the form and always make the action="/" (front page) which would always exist. If this is a good idea, how does one go about tapping into the FormAPI and overwriting the action? Is it a preprocess function?

    Read the article

  • Protect Plesk login page from search engine eyes

    - by Iman Samizadeh
    Hi Folks, I was wondering if would it be possible to protect the "https://www.DOMAIN.com:8443" URL from search engines listing perhaps using the htaccess to redirect the 8443 port from "DOMAIN" to elsewhere? This is the VZPP Plesk - Login Login to Plesk. Please enter your login information. Username. Password. Interface Language. User Default, ENGLISH (United States), GERMAN (Germany) ... https://www.DOMAIN.com:8443/ - Many Thanks.

    Read the article

  • Google Local Search API

    - by Gublooo
    hey guys couple of quick questions 1) In the local search results - we can get a lot of parameters like street title, address, city, state, lat, long , url etc - In order for me to uniquely identify this record - can I consider URL to be unique to this address or concatenation of latitude and longitude Ref: http://code.google.com/apis/ajaxsearch/documentation/reference.html#_class_GlocalResult 2) In terms of usage, depending upon what user enters, I'm displaying a list of local business for the user to choose. Now when a user selects a particular business address - is it legal for me to store that business address along with lat and longitude information in my database for future look ups. I've seen a lot of blogs talking about storing the lat/long info but just want to be sure that i'm not violating and google rules. Thanks

    Read the article

  • How do I save a macro consisting of multiple search and replace into my .vimrc

    - by Doppelganger
    I have a macro that I use to replace special characters for its html entities. I would like to save it in my .vimrc. According to this, I should use let @r=' *macro_text_goes_here* '. The problem is that my macro is a series of search and replace, something like this: :%s:á:\&aacute;:Ige :%s:é:\&eacute;:Ige :%s:í:\&iacute;:Ige So, I've tried with ^V-enter, <enter>, <CR> using real line breaks, but it never works. On the other side, if I put the text on a register and then run the macro, it works as expected.

    Read the article

  • Efficient mass string search problem.

    - by Monomer
    The Problem: A large static list of strings is provided. A pattern string comprised of data and wildcard elements (* and ?). The idea is to return all the strings that match the pattern - simple enough. Current Solution: I'm currently using a linear approach of scanning the large list and globbing each entry against the pattern. My Question: Are there any suitable data structures that I can store the large list into such that the search's complexity is less than O(n)? Perhaps something akin to a suffix-trie? I've also considered using bi- and tri-grams in a hashtable, but the logic required in evaluating a match based on a merge of the list of words returned and the pattern is a nightmare, and I'm not convinced its the correct approach.

    Read the article

  • Get all related products based on their full-text search relationship

    - by MikeJ
    I have a Product table with the fields Id, Title, Description, Keywords (just comma separated list of keywords). Table is full-text indexed. When I view one product, I do a query and search the full-text catalog for any related products based on the Keywords field. select * from Products where Contains(Products.*, @keywordsFromOneProduct) Works like a charm. Now I would like to list all products and all their related products in a big list and I want to avoid calling this method for each item. Any ideas how could I do it? I was thinking about a job that would go through products one by one and build a one-many mapping table (fields ProductId, RelatedProductId), but I wonder is there a better way?

    Read the article

  • search through related field for specific related object

    - by dotty
    Hay, I'm working on a simple voting system, where users can vote on a poll. My model looks like this class Poll(models.Model): question = models.CharField() votes = models.IntegerField() usersVoted = models.ManyToManyField(User) Now, i want to scan through the usersVoted field to see if a User object is in there. This User object will then be matched against a logged in User (User obj saved in a session). If the User has voted i want to be able to set a 'has_voted' field. I then want to use this field in my view. I will be using the Property() thingy inside the model to work this 'has_voted' value out. Like so def _can_vote(self): return False can_vote = property(_can_vote) Obviously it'll return a Bool. Any ideas how to search through a related field to find a specific Object?

    Read the article

  • Search object array for matching possible multiple values using different comparison operators

    - by Sparkles
    I have a function to search an array of objects for a matching value using the eq operator, like so: sub find { my ( $self, %params ) = @_; my @entries = @{ $self->{_entries} }; if ( $params{filename} ) { @entries = grep { $_->filename eq $params{filename} } @entries; } if ( $params{date} ) { @entries = grep { $_->date eq $params{date} } @entries; } if ( $params{title} ) { @entries = grep { $_->title eq $params{title} } @entries; } .... I wanted to also be able to pass in a qr quoted variable to use in the comparison instead but the only way I can think of separating the comparisons is using an if/else block, like so: if (lc ref($params{whatever}) eq 'regexp') { #use =~ } else { #use eq } Is there a shorter way of doing it? Because of reasons beyond my control I'm using Perl 5.8.8 so I can't use the smart match operator. TIA

    Read the article

  • Cannot see my wordpress website on google search

    - by ion
    Hi guys I recently uploaded a site made with wordpress. The site url is oakabeachvolley.gr I have set on the privacy settings of wordpress for the site to be visible by search engines. However after almost 45 days the site is invisible on google even when I'm searching using the url name and very specific keywords. Since I have made quite a few sites with wordpress I have never seen this behavior before. Sites will eventually be visible to google engine, sometimes even in the first day. However in this case the site does not show nowhere in the first 20 pages. Any help would be greatly appreciated.

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >