Search Results

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

Page 56/735 | < Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >

  • Why does Hibernate ignore the JPA2 standardized properties in my persistence.xml?

    - by Ophidian
    I have an extremely simple web application running in Tomcat using Spring 3.0.1, Hibernate 3.5.1, JPA 2, and Derby. I am defining all of my database connectivity in persistence.xml and merely using Spring for dependency injection. I am using embedded Derby as my database. Everything works correctly when I define the driver and url properties in persistence.xml in the classic Hibernate manner as thus: <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/> <property name="hibernate.connection.url" value="jdbc:derby:webdb;create=true"/> The problems occur when I switch my configuration to the JPA2 standardized properties as thus: <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/> <property name="javax.persistence.jdbc.url" value="jdbc:derby:webdb;create=true"/> When using the JPA2 property keys, the application bails hard with the following exception: java.lang.UnsupportedOperationException: The user must supply a JDBC connection Does anyone know why this is failing? NOTE: I have copied the javax... property strings straight from the Hibernate reference documentation, so a typo is extremely unlikely.

    Read the article

  • search engine (bing) lost my www

    - by Jason
    I just found that my site in the result of bing was broken, casue bing display wrong domain name: my site domain name: www.mysite.com; bing list my site domain name : mysite.com How can i ask bing to change it to the right one? Another search engines list it correctly.

    Read the article

  • Dolphin search bar missing. How can i get it back?

    - by Ike
    A while ago, my search bar went missing in dolphin. If the search toolbar is checked for view/unhide, nothing shows up. I noticed if i check and uncheck the button to hide/unhide it, a small, thin content-less bar slightly pushes the rest of the toolbar up. i tried reconfiguring with dpkg, purging and reinstalling, etc. i left it alone as i thought it would be fixed in an update, but today i upgraded daolphin and it's still gone. any thoughts?

    Read the article

  • How to use Hibernate SchemaUpdate class with a JPA persistence.xml?

    - by John Rizzo
    I've a main method using SchemaUpdate to display at the console what tables to alter/create and it works fine in my Hibernate project: public static void main(String[] args) throws IOException { //first we prepare the configuration Properties hibProps = new Properties(); hibProps.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("jbbconfigs.properties")); Configuration cfg = new AnnotationConfiguration(); cfg.configure("/hibernate.cfg.xml").addProperties(hibProps); //We create the SchemaUpdate thanks to the configs SchemaUpdate schemaUpdate = new SchemaUpdate(cfg); //The update is executed in script mode only schemaUpdate.execute(true, false); ... I'd like to reuse this code in a JPA project, having no hibernate.cfg.xml file (and no .properties file), but a persistence.xml file (autodetected in the META-INF directory as specified by the JPA spec). I tried this too simple adaptation, Configuration cfg = new AnnotationConfiguration(); cfg.configure(); but it failed with that exception. Exception in thread "main" org.hibernate.HibernateException: /hibernate.cfg.xml not found Has anybody done that? Thanks.

    Read the article

  • Total row count for pagination using JPA Criteria API

    - by ThinkFloyd
    I am implementing "Advanced Search" kind of functionality for an Entity in my system such that user can search that entity using multiple conditions(eq,ne,gt,lt,like etc) on attributes of this entity. I am using JPA's Criteria API to dynamically generate the Criteria query and then using setFirstResult() & setMaxResults() to support pagination. All was fine till this point but now I want to show total number of results on results grid but I did not see a straight forward way to get total count of Criteria query. This is how my code looks like: CriteriaBuilder builder = em.getCriteriaBuilder(); CriteriaQuery<Brand> cQuery = builder.createQuery(Brand.class); Root<Brand> from = cQuery.from(Brand.class); CriteriaQuery<Brand> select = cQuery.select(from); . . //Created many predicates and added to **Predicate[] pArray** . . select.where(pArray); // Added orderBy clause TypedQuery typedQuery = em.createQuery(select); typedQuery.setFirstResult(startIndex); typedQuery.setMaxResults(pageSize); List resultList = typedQuery.getResultList(); My result set could be big so I don't want to load my entities for count query, so tell me efficient way to get total count like rowCount() method on Criteria (I think its there in Hibernate's Criteria).

    Read the article

  • Displaying thumbnails in google search results for flash games?

    - by serg
    Some sites are somehow displaying video preview thumbnails for pages that contain flash games in google search results. For example search for: site:www.thorgaming.com game I see this only on small sites which makes me believe google is not very happy about it. How do they do it and is it ok with google? I assume they are submitting thumbnails through video sitemaps, but I can't find any information about using them with flash games. I also run a few such sites through rich snipped testing tool and it didn't detect any microdata tags on a page.

    Read the article

  • Does Hibernate support one-to-one associations as pkeys?

    - by Andrzej Doyle
    Hi all, Can anyone tell me whether Hibernate supports associations as the pkey of an entity? I thought that this would be supported but I am having a lot of trouble getting any kind of mapping that represents this to work. In particular, with the straight mapping below: @Entity public class EntityBar { @Id @OneToOne(optional = false, mappedBy = "bar") EntityFoo foo // other stuff } I get an org.hibernate.MappingException: "Could not determine type for: EntityFoo, at table: ENTITY_BAR, for columns: [org.hibernate.mapping.Column(foo)]" Diving into the code it seems the ID is always considered a Value type; i.e. "anything that is persisted by value, instead of by reference. It is essentially a Hibernate Type, together with zero or more columns." I could make my EntityFoo a value type by declaring it serializable, but I wouldn't expect this would lead to the right outcome either. I would have thought that Hibernate would consider the type of the column to be integer (or whatever the actual type of the parent's ID is), just like it would with a normal one-to-one link, but this doesn't appear to kick in when I also declare it an ID. Am I going beyond what is possible by trying to combine @OneToOne with @Id? And if so, how could one model this relationship sensibly?

    Read the article

  • Search engine to correlate events [closed]

    - by Lee B
    Are there any web search tools that help with statistical research, like correlation? For instance, if I wanted to see the union of bloggers who drink (or talk about) tea/coffee with the bloggers who experience (or talk about) various diseases?

    Read the article

  • How can I create multiple mini-sites with similar/duplicate content without hurting my search engine rank?

    - by ekpyrotic
    Essential background: I run a small company that lets members of the public post handwritten letters to their local politician (UK-based). Every week a number of early stage bills (called Early Day Motions) are submitted for debate in the House of Commons, and supporters of the motion will contact their local Members of Parliament, asking them to sign the motion. The crux: I want to target these EDMs with customised mini-sites, so when people search "EDM xxx", they find my customised mini-site, specifically targeting that EDM (i.e., "Send a handwritten letter to your MP asking them to sign EDM xxx"). At the moment, all these mini-sites (and my homepage) have duplicate content with only the relevant EDM name, number, and background image changed. (For example, http://mailmymp.com and http://mailmymp.com/edm/teaching-life-saving-skills-at-school-edm-550.php). The question: Firstly, will this hurt my potential search engine ranking? And, if so, what's the best way to target these political campaigns in an efficient manner without hurting my SEO prospects?

    Read the article

  • JAVA MySql multiple word search

    - by user1703849
    i have a database in MySql that has a name column in it which contains several words(description). I am connected to database with java through eclipse. I have a search, that returns results if only name field contains one word. id: name: info: type: 1 balloon big red balloon big 2 house expensive beautiful luxury 3 chicken wings deep fried wings tasty these are just random words but as an example my search can only see ex. balloon and then show info, but if i type chicken wings, it does nothing. so it possible somehow to search from columns with multiple words? this is my search code below import java.io.*; import java.sql.*; import java.util.*; class Search { public static void main(String[] args) { Scanner inp``ut = new Scanner(System.in); try { Connection con = DriverManager.getConnection( "jdbc:mysql://example/mydb", "user", "password"); Statement stmt = (Statement) con.createStatement(); System.out.print("enter search: "); String name = input.next(); String SQL = "SELECT * FROM menu where name LIKE '" + name + "'"; ResultSet rs = stmt.executeQuery(SQL); while (rs.next()) { System.out.println("Name: " +rs.getString("name")); System.out.println("Description: " + rs.getString("info") ); System.out.println("Price: " + rs.getString("Price")); } } catch (Exception e) { System.out.println("ERROR: " + e.getMessage()); } } }

    Read the article

  • Getting my webapp to be database agnostic with Hibernate...

    - by JellyHead
    So the ultimate in scope-creep came in the other day: since we're using Hibernate, could we make our webapp run on Oracle as well as MySQL, interchangably? I thought this would be a simple case of changing hibernate.cfg.xml so that instead of explicity stating MySQL-specific options, it would reference a JNDI datasource, allowing the application to build regardless of the database we intend to deploy to. Then changing to a different database would simply mean changing the separate datasource configuration in JBoss, Jetty, WebLogic etc. Is this realistic? Well, I got as far as setting that up in Jetty, but What's tripping me up right now is error about the hibernate.dialect not having been set in hibernate.cfg.xml. But If I set the dialect there, then my app is still going to be built in either MySQL or Oracle flavours, which is not really what I want. Either I'm trying to attempt the impossible or I've missed something fundamentally obvious... anyone else had a similar problem (and subsequent solution/workaround)?

    Read the article

  • how to make an ajax search

    - by amir
    I'm trying to make an ajax search for a website, HTML : <form id="search" method="post" action="search.php"> <input type="text" name="search" /> <input type="image" name="submit" alt="search" src="images/buttons/search.gif" /> </form> $(function() { var search_text = ''; $('form#search input[name=submit]').click(function() { search_text = $('form#search input[name=search]').val(); $.get('../search.php',{ s: search_text }); return false; }); }); in the search.php file I have the following <?php $search = $_GET['s']; if (isset($_POST['submit_x'])) { $search = $_POST['search']; $search = str_replace(' ','',$search); $search = strtolower($search); if($search == 'kingbabychosenheart' || $search == 'chosenheart' || $search == 'beltchosenheart') { echo "<meta http-equiv='refresh' content='0;url=chosen_heart.php'>"; } else { echo "<meta http-equiv='refresh' content='0;url=not_found.php'>"; } } ?> but this doesn't work, what else do I have to do to make this work? thanks

    Read the article

  • Search string in file (C)

    - by chutsu
    So my code isn't working... test.c:27: warning: passing argument 1 of ‘search’ from incompatible pointer type which is the fgets line. My code opens a file, reads the file line by line, and I'm trying to create a "search" function that will return a value that indicates whether that string is found on that line of the file. My ultimate goal is to achieve a search and replace program. But one step at a time eh? this is what I have so far: #include <stdio.h> #include <string.h> int search(const char *content[], const char *search_term) { int t; for(t=0; content[t]; ++t){ if(!strcmp(content[t], search_term)){ return t; // found } } return 0; // not found } int main(int argc, char *argv[]) { FILE *file; char line[BUFSIZ]; int linenumber=0; char term[20] = "hello world"; file = fopen(argv[1], "r"); if(file != NULL){ while(fgets(line, sizeof(line), file)){ if(search(line, term) != -1){ printf("Search Term Found!!\n"); } ++linenumber; } } else{ perror(argv[1]); } fclose(file); return 0; }

    Read the article

  • Get context for search string in text in C#

    - by soundslike
    Given a string text which contains newline there is a search keyword which matches an item within the text. How do I implement the following in C#: searchIdx = search index (starting with 0, then 1, etc. for each successive call to GetSearchContext. Initially start with 0. contextsTxt = string data to search in searchTxt = keyword to search for in contextsTxt numLines = number of lines to return surrounding the searchTxt found (ie. 1 = the line the searchTxt is found on, 2 = the line the searchTxt is found on, 3 = the line above the searchTxt is found on, the line the searchTxt is found on, and the line below the searchTxt is found on) returns the "context" based on the parameters string GetSearchContext(int searchIdx, string contentsTxt, string searchTxt, int numLines); If there's a better function interface to accomplish this feel free to suggest that as well. I tried the following but doesn't seem to work properly all the time: private string GetSearchContext(string contentValue, string search, int numLines) { int searchIdx = contentValue.IndexOf(search); int startIdx = 0; int lastIdx = 0; while (startIdx != -1 && (startIdx = contentValue.IndexOf('\n', startIdx+1)) < searchIdx) { lastIdx = startIdx; } startIdx = lastIdx; if (startIdx < 0) startIdx = 0; int endIdx = searchIdx; int lineCnt = 0; while (endIdx != -1 && lineCnt++ < numLines) { endIdx = contentValue.IndexOf('\n', endIdx + 1); } if (endIdx == -1 || endIdx > contentValue.Length - 1) endIdx = contentValue.Length - 1; string lines = contentValue.Substring(startIdx, endIdx - startIdx + 1); if (lines[0] == '\n') lines = lines.Substring(1); if (lines[lines.Length - 1] == '\n') { lines = lines.Substring(0, lines.Length - 1); } if (lines[lines.Length - 1] == '\r') { lines = lines.Substring(0, lines.Length - 1); } return lines; }

    Read the article

  • How to map oracle timestamp to appropriate java type in hibernate?

    - by jschoen
    I am new to hibernate and I am stumped. In my database I have tables that have a columns of TIMESTAMP(6). I am using Netbeans 6.5.1 and when I generate the hibernate.reveng.xml, hbm.xml files, and pojo files it sets the columns to be of type Serializable. This is not what I expected, nor what I want them to be. I found this post on the hibernate forums saying to place: in the hibernate.reveng.xml file. In Netbeans you are not able to generate the mappings from this file (it creates a new one every time) and it does not seem to have the ability to re-generate them from the file either (at least according to this it is slated to be available in version 7). So I am trying to figure out what to do. I am more inclined to believe I am doing something wrong since I am new to this, and it seems like it would be a common problem for others. So what am I doing wrong? If I am not doing anything wrong, how do I work around this? I am using Netbeans 6.5, Oracle 10G, and I believe Hibernate 3 (it came with my netbeans). Edit: Meant to say I found this stackoverflow question, but it is really a different problem.

    Read the article

  • What are the hibernate annotations used to persist a Map with an enumerated type as a key?

    - by Jason Novak
    I am having trouble getting the right hibernate annotations to use on a Map with an enumerated class as a key. Here is a simplified (and extremely contrived) example. public class Thing { public String id; public Letter startLetter; public Map<Letter,Double> letterCounts = new HashMap<Letter, Double>(); } public enum Letter { A, B, C, D } Here are my current annotations on Thing @Entity public class Thing { @Id public String id; @Enumerated(EnumType.STRING) public Letter startLetter; @CollectionOfElements @JoinTable(name = "Thing_letterFrequencies", joinColumns = @JoinColumn(name = "thingId")) @MapKey(columns = @Column(name = "letter", nullable = false)) @Column(name = "count") public Map<Letter,Double> letterCounts = new HashMap<Letter, Double>(); } Hibernate generates the following DDL to create the tables for my MySql database create table Thing (id varchar(255) not null, startLetter varchar(255), primary key (id)) type=InnoDB; create table Thing_letterFrequencies (thingId varchar(255) not null, count double precision, letter tinyblob not null, primary key (thingId, letter)) type=InnoDB; Notice that hibernate tries to define letter (my map key) as a tinyblob, however it defines startLetter as a varchar(255) even though both are of the enumerated type Letter. When I try to create the tables I see the following error BLOB/TEXT column 'letter' used in key specification without a key length I googled this error and it appears that MySql has issues when you try to make a tinyblob column part of a primary key, which is what hibernate needs to do with the Thing_letterFrequencies table. So I would rather have letter mapped to a varchar(255) the way startLetter is. Unfortunately, I've been fussing with the MapKey annotation for a while now and haven't been able to make this work. I've also tried @MapKeyManyToMany(targetEntity=Product.class) without success. Can anyone tell me what are the correct annotations for my letterCounts map so that hibernate will treat the letterCounts map key the same way it does startLetter?

    Read the article

  • Is there any advantage for using a library other than Hibernate for JPA?

    - by Jeduan Cornejo
    Hi, I've been using JPA for some time now and been in projects where we've used both Hibernate Annotations and Toplink Essentials. AFAIK the project leader chose Toplink because Netbeans had it integrated and seemed to be the easy thing to do. However when looking for help, most of the literature seemed to assume that you are using Hibernate as the JPA provider, so, the question is, is have you found any advantage, performance or otherwise for not using the de-facto standard for JPA, Hibernate?

    Read the article

  • Will a search engine lower the rank of my page if i have hidden iframes?

    - by Skurpi
    As a praxis, all external content on our site is put in iframes to lower the risks of any external parties injecting stuff to our users. We also do it to make sure our content shows up before banners, to make the site feel quicker. We now have an external script running which we want to put in an iframe, but it does not have any visible content to go with it so I want to put css "visibility: hidden;" on the iframe. I read in a forum somewhere that search engines will lower the rank of a page, or even drop the page, if a iframe has "the minimal size of 1x1px". Will a search engine lower the rank of my page if I have a hidden (or 1px big) iframe?

    Read the article

< Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >