Search Results

Search found 960 results on 39 pages for 'annotations'.

Page 22/39 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Why use spaces instead of tabs for indentation? [closed]

    - by erenon
    Possible Duplicate: Are spaces preferred over tabs for indentation? Why do most coding standards recommend the use of spaces instead of tabs? Tabs can be configured to be as many characters wide as needed, but spaces can't. Example: Zend cs Pear cs Pear manual: This helps to avoid problems with diffs, patches, SVN history and annotations. How could tabs cause problems?

    Read the article

  • what is the difference between latitude, longitude and their delat values.

    - by Mas
    Hi! I'm new to the MKMapView (iPhone). I want to add several annotations to the map of Copenhagen (Denmark). I have the latitude and longitude values of different locations of the city. But I don't know how to get the longitudeDelta and latitudeDelta of these locations. I'm using the Google Map API's to calculate the latitude and longitude values (By web services) of each location in the city map. I need help on how to calculate delta values Thanks

    Read the article

  • How can I load a property lazily in JDO (on Google App Engine)?

    - by luciano
    I have this code in one of my @PersistenceCapable classes: @Persistent private Blob data; The Blob can be quite big, so I'd like to load it lazily since most of the times I don't need it. How can I annotate that property to avoid immediate loading? I could create another class that contains the Blob alone and then use a lazy one-to-one, but I'd like to solve this with annotations.

    Read the article

  • How to do multiple column UniqueConstraint in hbm?

    - by DataSurfer
    Working on some legacy hibernate code. How do I do the following with hbm.xml(hibernate mapping file) instead of with annotations? @Table(name="users", uniqueConstraints = { @UniqueConstraint(columnNames={"username", "client"}), @UniqueConstraint(columnNames={"email", "client"}) }) public class User implements Serializable { private static final long serialVersionUID = 1L; @Id private int id; private String username; private String email; private Client client; }

    Read the article

  • Generated queries contain schema and catalog name

    - by stacker
    I've the same problem as described here In the generated SQL Informix expects catalog:schema.table but what's actually generated is catalog.schema.table which leads to a syntax error. Setting: hibernate.default_catalog= hibernate.default_schema= had no effect. I even removed schema and catalog from the table annotation, this caused a different issues : the query looked like that ..table same for setting catalog and schema to an empty string. Versions seam 2.1.2 Hibernate Annotations 3.3.1.GA.CP01 Hibernate 3.2.4.sp1.cp08 Hibernate EntityManager 3.3.2.GAhibernate Jboss 4.3 (similar to 4.2.3)

    Read the article

  • No unique bean of type [javax.persistence.EntityManager] is defined

    - by sebajb
    I am using JUnit 4 to test Dao Access with Spring (annotations) and JPA (hibernate). The datasource is configured through JNDI(Weblogic) with an ORacle(Backend). This persistence is configured with just the name and a RESOURCE_LOCAL transaction-type The application context file contains notations for annotations, JPA config, transactions, and default package and configuration for annotation detection. I am using Junit4 like so: ApplicationContext <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="workRequest"/> <property name="dataSource" ref="dataSource" /> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="databasePlatform" value="${database.target}"/> <property name="showSql" value="${database.showSql}" /> <property name="generateDdl" value="${database.generateDdl}" /> </bean> </property> </bean> <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>workRequest</value> </property> <property name="jndiEnvironment"> <props> <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop> <prop key="java.naming.provider.url">t3://localhost:7001</prop> </props> </property> </bean> <bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory" /> </bean> <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/> <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /> JUnit TestCase @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:applicationContext.xml" }) public class AssignmentDaoTest { private AssignmentDao assignmentDao; @Test public void readAll() { assertNotNull("assignmentDao cannot be null", assignmentDao); List assignments = assignmentDao.findAll(); assertNotNull("There are no assignments yet", assignments); } } regardless of what changes I make I get: No unique bean of type [javax.persistence.EntityManager] is defined Any hint on what this could be. I am running the tests inside eclipse.

    Read the article

  • SQL 2005 - any way to restore/copy a diagram?

    - by NealWalters
    I used the Redgate packager (ran MSI) to reset all the data in my database (i.e. I deleted everything, and let it build the new database). Unfortunately, I discovered that it didn't retain my diagrams, which has a nice arrangement and several annotations. Is there any way to copy/migrate/script the diagram from one database to another (the databases have identical structures). Thanks, Neal Walters

    Read the article

  • How do I load all my location based content into google maps

    - by user333639
    I am writing an iPad application that uses the MapKit control. How do I get all my content into Google Maps. i.e. I have a bunch of locations along with photos, video, audio and various other information. So when the iPad user loads my App and zooms into a certain place in the world I want my Annotations to be visible and when they touch the pins they get access to more information etc.

    Read the article

  • what's the best practice to config Hibernate-Spring for multiple database relationship?

    - by nazila
    We have a main mysql database which all of the applications within our organization need the data within this database. How can I config my java web application to use this database with it's specific database when I use Spring and Hibernate within my application? How can I config JPA annotations for example between CONTRACT table within my database and COUNTRY table within our main database? what's the best practice to do this?

    Read the article

  • How to disable sql creation for JPA entity classes

    - by Samuel
    We have some JPA entity classes which are currently under development and wouldn't want them as part of the testing cycle. We tried commenting out the relevant entity classes in META-INF\persistence.xml but the hbm2ddl reverse engineering tool still seems to generate SQL for those entities. How do I tell my code to ignore these classes? Are there any annotations for these or should I have to comment out the @Entity annotation along with my changes in persistence.xml file.

    Read the article

  • Set creation and update time with Hibernate in Xml mappings

    - by Marco
    Hi, I'm using Hibernate with Xml mappings. I have an entity that has two fields creationDate and updateDate of type timestamp, that have to be filled with the current UTC time when the entity is persisted and updated. I know about the existence of the @PrePersist and @PreUpdate annotations, but i don't know how to use their equivalent in my Xml mappings. Again, i was wondering if Hibernate somehow supports natively the update and creation time set. Thanks

    Read the article

  • Need (logback)Teefilter sample code - sprinng/Eclipse

    - by user359942
    I am looking for more complete sample code on how TeeFilter of Logback can be used to log HTTP messages. I am trying to add this support to my Spring 3 (MVC)/Hibernate 3/Annotations Maven2 project. I have the config and xml files but I need to know where and how I can trigger this Filter to do the job for me in the Spring MVC framework. Any help will be greatly appreciated.

    Read the article

  • Set a default value to a property

    - by BrunoLM
    Is it possible to set a default value without the body of a property? Maybe through annotations? [SetTheDefaultValueTo(true)] public bool IsTrue { get; set; } [SetTheDefaultValueTo(false)] public bool IsFalse { get; set; } public void Something() { var isTrue = this.IsTrue; var isFalse = this.IsFalse; }

    Read the article

  • Reg Google app engine datastore -primarykey

    - by megala
    hi, I created table in google Big table datastore ,In that the i set primary key using @annotations as follows @Id @Column(name = "groupname") private String groupname; @Basic private String groupdesc; I worked corretly,but it override the previous record,how to solve this for eg if i entered groupname=group1 groupdesc=groupdesc than it accept after that i enter same groupname it override previous record for eg groupname=group1 groupdesc=groups this record override previous one.

    Read the article

  • Hibernate one to one with multiple columns

    - by Erdem Emekligil
    How can i bind two columns, using @OneToOne annotation? Lets say I've 2 tables A and B. Table A: id1 (primary key) id2 (pk) other columns Table B: id1 (pk) id2 (pk) other columns In class A i want to write something like this: @OneToOne(fetch = FetchType.EAGER, targetEntity = B.class) @JoinColumn(name = "id1 and id2", referencedColumnName = "id1 and id2") private B b; Is it possible to do this using annotations? Thanks.

    Read the article

  • Force update in Hibernate

    - by gubrutz
    How can I force Hibernate to update an entity instance even if the entity is not dirty? I'm using Hibernate 3.3.2 GA, Hibernate Annotations and Hibernate EntityManager btw. I really want Hibernate to execute the generic UPDATE statement even if no property on the entity has changed. I need this because some event listeners need to get invoked to do some additional work when the application runs for the first time. Thanks!

    Read the article

  • Caching with Spring Framework

    - by Francois
    Spring Modules had a @Cacheable annotation: org.springmodules.cache.annotations.Cacheable Now that Spring Module is deprecated, what is the recommendation for caching? And is still still possible to work with ehCache?

    Read the article

  • JPA CascadeType.ALL does not delete orphans.

    - by Paul Whelan
    I am having trouble deleting orphan nodes using JPA with the following mapping @OneToMany (cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "owner") private List<Bikes> bikes; I am having the issue of the orphaned roles hanging around the database. I can use the @org.hibernate.annotations.Cascade Hibernate specific tag but obviously I don't want to tie my solution into a hibernate implementation. Any pointers greatly appreciated.

    Read the article

  • How can I return a Future object with Spring without writing concurrency logic?

    - by Johan
    How can I return a java.util.concurrent.Future object with a Receipt object and only use the @javax.ejb.Asynchronous annotation? And do I need any extra configuration to let Spring handle ejb annotations? I don't want to write any concurrency logic myself. Here's my attempt that doesn't work: @Asynchronous public Future<Receipt> execute(Job job) { Receipt receipt = timeConsumingWork(job); return receipt; }

    Read the article

  • pdf <pre> equivalent

    - by ddowns
    I'm trying to put some code examples in a pdf, but copying them out messes up the formatting and rearranges the lines, there's a lot of manual cleanup needed after pasting. Is there a equivalent to html's pre for PDFs? For "this" block of text respect line breaks, spacing, and copy as plain text like its shown. The closest thing I can see is adding note annotations next to every code example.

    Read the article

  • Hibernate Lazy Loading Proxy Incompatable w/ Other Frameworks

    - by bowsie
    I've come across several instances where frameworks that take POJOs to do some work crap-out with proxied hibernate beans. For example if I xml annotate a bean for framework X and pass it to framework X it doesn't recognise the bean because it is passed the proxied object - which has no annotations for framework X. Is there a common solution to this? I'd prefer not to define the bean as eager loaded, or turn of lazy-loading anywhere in the application. Thoughts? Thanks.

    Read the article

  • Hibernate Queries

    - by Schildmeijer
    Using Named Queries (located in your hibernate mapping xml file) is a nice way to separate your queries from your buisness logic. But what are the alternatives if your are using Hibernate Annotations for mapping?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >